Locate simple large objects in open files

To have locate the TEXT or BYTE data in an open file, set the loc_loctype field of the locator structure to LOCFILE.
EXEC SQL BEGIN DECLARE SECTION;
    loc_t my_simple_lo;
EXEC SQL END DECLARE SECTION;
;

my_simple_lo.loc_loctype = LOCFILE; 

To use an open file as a simple-large-object location, your program must open the desired file before it accesses the simple-large-object data. It must then store its file descriptor in the loc_fd field of the locator structure to specify this file as the simple-large-object location. The loc_oflags field should also contain a file-open mode flag to tell how to access the file when it opens it.

The demo directory contains the following two sample programs that demonstrate how to handle simple-large-object data located in an open file:
  • The getcd_of.ec program selects a simple large object into an open file.
  • The updcd_of.ec program inserts a simple large object from an open file.
These programs assume the stores7 database as the default database for the simple-large-object data. The user can specify another database (on the default database server) as a command-line argument:
getcd_of mystores