Locate simple large objects in files

You can locate simple-large-object data in the open or named types of files.

  • An open file is one that has already been opened before the program accesses the simple-large-object data. The program provides a file descriptor as the location of the simple-large-object data.
  • A named file is one that your program has not yet opened. The program provides a file name as the location of the simple-large-object data.
When you use a file as a simple-large-object location, a locator structure uses the lc_file structure for the lc_union structure. The following table summarizes the lc_union.lc_file fields.
Table 1. Fields in lc_union.lc_file structure used for simple large objects located in files
Field Data type Description
lc_fname char * The address of the path name string that contains the file for the simple-large-object data. The program sets this field when it uses named files for simple-large-object locations.
lc_mode int The permission bits to use to create a file. This value is the third argument passed to the system open() function. For valid values of lc_mode, see your system documentation.
lc_fd int The file descriptor of the file that contains the simple-large-object data. The program sets this field when it uses open files.
lc_position 4-byte integer The current seek position in the opened file. This is an internal field and must not be modified by the ESQL/C program.
The locator.h file provides the following macro shortcuts to use when you access simple large objects stored in files:
#define loc_fname       lc_union.lc_file.lc_fname
#define loc_fd          lc_union.lc_file.lc_fd
#define loc_position    lc_union.lc_file.lc_position
Tip: It is recommended that you use these shortcut names when you access the locator structure. The shortcut names improve code readability and reduce coding errors. This publication uses these shortcut names when it refers to the lc_fname, lc_fd, and lc_position fields of the lc_union.lc_file structure.