Re[2]: Blobs: How to tell when I retrieved a null blob
Posted in 1997
Hi there, To pass a blob by reference from 4gl to C functions, call your C function using blob variable: 4gl code snippet: ----------------- define MyBlobVar byte --- some more stuff... call MyCFunction( MyBlobVar ) In the C function, you get the blob using the function "poplocator": C code snippet: --------------- int MyCFunction( x ) int x; { loc_t *MyBlobVar; /* Blob structure */ /* Test parameter stack, etc */ poplocator( &MyBlobVar ); /* Gets address of blob */ /* even more stuff */ } ______________________________ Reply Separator _________________________________ Subject: Re: Blobs: How to tell when I retrieved a null blob Author: jake@apparel.net at Internet Date: 17/2/97 9:38 AM >> After you've set the blob to NULL, it stays NULL permanently (there >> was a bug entered about this some time ago; I forget the number). >>I > think you have to re-locate the blob to unset the null-ness >>pointer, or drop into C (ESQL/C) code passing the blob (by >>reference, not >> value!) as an argument, and therefore using poplocator() in the C >> code, and fiddle the indicator portion of the loc_t structure you >>are given. >Actually, I had no trouble with this in RDS. I set blob var to null >once for one test insert and easily re-located it in a file for >another insert. No C was necessary. >You have, however, just opened another can of worms, worthy of a >separate thread: How would I pass a blob locator structure to a C >function by reference? I was never aware of any syntax for doing >this.