Insert a simple large object into a user-defined location

When your program inserts a simple-large-object value, the libraries must transfer the data from the program to the database server. To do this, performs the following steps:
  1. Before the transfer, calls the user-defined open function to initialize the user-defined location. The oflags argument of this open function is set to LOC_RONLY.
  2. calls the user-defined read function to transfer the simple-large-object data from the user-defined location to the program buffer.
  3. sends the value in the program buffer to the database server.

    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.

  4. After the transfer, 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 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.