Length of a LONG RAW field

BlueRonin

Member
I've looked at the longraw demo. Is their a more direct way to determine the size of a LONG RAW field than looping through the fetch?

Code:
do {
   Length = GetLongRawQuery->GetLongField(0, &Buffer, Offset, 1500);
   Offset = Offset + 1500;
 } while (Length >= 1500);
 
No, the size of a long raw is only known when all data has been fetched. You can alternatively store the length in a separate number column, which you have to maintain in your application.

An even better option is to use a BLOB column of course, for which you can determine the length without fetching any data.
 
Unfortunately, I'm working with a legacy application and can't change the type. I guess that I'll just have to do the loop and keep realloc'ing the memory for the image.

Thanks
Mike
 
Back
Top