Insert a simple large object into a user-defined location
- Before the transfer, Informix ESQL/C calls the user-defined open function to initialize the user-defined location. The oflags argument of this open function is set to LOC_RONLY.
- Informix ESQL/C calls the user-defined read function to transfer the simple-large-object data from the user-defined location to the program buffer.
- Informix
ESQL/C sends
the value in the program buffer to the database server.
Informix ESQL/C repeats steps 2 and 3 as many times as needed to transfer the entire simple-large-object value from the user-defined location to the database server.
- After the transfer, Informix ESQL/C performs the clean-up operations specified in the user-defined close function.
To insert a simple large object that is stored in a user-defined location, set loc_loctype to LOCUSER and set the loc_open, loc_read, and loc_close fields so that they contain the addresses of appropriate user-defined open, read, and close functions. If the simple large object to be inserted is null, set the loc_indicator field to -1.
Set the loc_size field to the length of the simple-large-object data that you insert. A loc_size value of -1 tells Informix ESQL/C to send the entire user-defined simple-large-object data in a single operation. If the program sets loc_size to -1, the database server reads in data until the read function returns an end-of-file (EOF) signal. When the count is not equal to the number of bytes requested, the database server assumes an EOF signal.