Example: Inserting data into a CLOB column
This example shows how to insert data from a
regular file referenced by :hv_text_file into a character
large object (CLOB) column.
In the path description of the following C program segment:
useridrepresents the directory for one of your users.dirnamerepresents a subdirectory name ofuserid
.filnam.1can become the name of one of your documents that you want to insert into the table.clobtabis the name of the table with the CLOB data type.
strcpy(hv_text_file.name, "/home/userid/dirname/filnam.1");
hv_text_file.name_length = strlen("/home/userid/dirname/filnam.1");
hv_text_file.file_options = SQL_FILE_READ; /* this is a 'regular' file */
EXEC SQL INSERT INTO CLOBTAB
VALUES(:hv_text_file);