Hello,
according to the documentation of SQLBindCol it should be possible to get only the column length information by setting TargetValuePtr to NULL and StrLen_or_IndPtr to a valid value:
TargetValuePtr
...
If TargetValuePtr is a null pointer, the driver unbinds the data buffer for the column. ... An application can unbind the data buffer for a column but still have a length/indicator buffer bound for the column, if theTargetValuePtr argument in the call to SQLBindCol is a null pointer but theStrLen_or_IndPtrargument is a valid value.
I tried that, but StrLen_or_IndPtr does not get filled.
My idea is to get the length of an unbound long data column this way and then later call SQLGetData only if the length is > 0.
What am I doing wrong?