Example: Extracting CLOB data to a file
Suppose that you need to retrieve character large object (CLOB) elements from a table into an external file.
How the example LOBFILE program works
The example program has three sections that work with the CLOB file reference variable:
- Declare host variables. A CLOB file reference host variable is declared. The declaration is expanded as a structure that includes declarations for a file name, file name length, and file options.
- CLOB file reference host variable is set up. The attributes of the file reference are set up. A file name without a fully declared path is, by default, placed in the user's current directory. If the path name does not begin with the forward slash (/) character, it is not qualified.
- Select into the CLOB file reference host variable. The data from the resume field is selected into the file name that is referenced by the host variable.