Select a simple large object into a user-defined location

When your program selects a simple-large-object value, the Informix® ESQL/C libraries must receive the data from the database server and transfer it to the Informix® ESQL/C program. To do this, Informix® ESQL/C performs the following steps:
  1. 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_WONLY.
  2. Informix® ESQL/C receives the simple-large-object value from the database server and puts it into a program buffer.
  3. Informix® ESQL/C calls the user-defined write function to transfer the simple-large-object data from the program buffer to the user-defined location.

    Informix® ESQL/C repeats steps 2 and 3 as many times as needed to transfer the entire simple-large-object value from the database server to the user-defined location.

  4. After the transfer, Informix® ESQL/C performs the clean-up operations that the user-defined close function specifies.

To select a simple large object into a user-defined location, set loc_loctype to LOCUSER and set the loc_open, loc_write, and loc_close fields so they contain the addresses of appropriate user-defined open, write, and close functions.