Locate simple large objects in named files
EXEC SQL BEGIN DECLARE SECTION;
loc_t my_simple_lo;
EXEC SQL END DECLARE SECTION;
my_simple_lo.loc_loctype = LOCFNAME;
To use a named file as a simple-large-object location, your Informix® ESQL/C program must specify a pointer to the file name in the loc_fname field of the locator structure. You must also set the loc_oflags field with a file-open mode flag to tell Informix® ESQL/C how to access the file when it opens it.
To open a named file, Informix®
ESQL/C opens
the file named in the loc_fname field with the mode flags that
the loc_oflags field specifies. If this file does not exist, Informix®
ESQL/C creates
it. Informix®
ESQL/C then
puts the file descriptor of the open file in the loc_fd field
and proceeds as if your program opened the file. If Informix®
ESQL/C cannot
open this file, it sets the loc_status field (and SQLCODE)
to -461
. When the transfer is complete, Informix®
ESQL/C closes
the file, which releases the file descriptor in the loc_fd field.
- The getcd_nf.ec program selects a simple large object into a named file.
- The updcd_nf.ec program inserts a simple large object from a named file.
getcd_of mystores