SQLGetData expects the buffer length parameter to be a SQLLEN variable, which is a signed type. SQL_NULL_DATA is defined as -1, which is 4294967295 if you interpret it as an unsigned type.
Your my_buff_len variable is being set to SQL_NULL_DATA correctly, but you are looking at it wrong. Change it to be the correct type, and it will work as you expect.
Regards, Harun
Thanks for the reply.
my_buff_len is defined as SQLLEN SQLLEN my_buff_len;