Re: ESQL/C and BLOBS....
Posted in 1997
Topics: Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL
Heikki Karhunen <Heikki.Karhunen@kone.com> writes: > Greetings! [ snip ] > Here I have bit of a problem with the ESQL/C and blob interface. The > filename of the blob can be found in the file where all the other > columns are stored. That is not a problem. I set up the locator like > this: > > a_contents.loc_size = -1; > a_contents.loc_loctype = LOCFNAME; > a_contents.loc_fname = bfname; > a_contents.loc_oflags = LOC_RONLY; ...and here is the problem. Actually not exactly in this piece of code, but as I tried to be clever and set the a_contents.loc_indicator to -1 when I encounter a NULL blob. But I never did set the loc_indicator to 0 after fooling around with a NULL blob... a_contents.loc_indicator = 0; [ snip ] > Ok? Not ok... After this statement I test the value sqlca.sqlcode > and it invariably is 0, but the contents of these blobs are all NULL > in the database. What do I do wrong here? And where have all the > blobs gone... And as it happens, this is exactly the way this code should and would work with the locator values provided. I hope someone found this tirade entertaining... HTK -- /-----------------------------+-----------------------------------------\\ | Heikki.Karhunen@helsinki.fi | There is always a job for a theoretical | | Heikki.Karhunen@kone.com | physicist -- at least in theory. | \\-----------------------------+-----------------------------------------/