Try OpenEdge Now
skip to main content
ABL Data Types Addenda
Using large objects in ABL : Creating a CLOB from a file
 

Creating a CLOB from a file

The following example copies a file to a CLOB field. The COPY-LOB statement converts the text in eucjis to the -cpinternal code page:
/*
Assume that fldClob is a CLOB field in a table.
The code page of this file is eucjis. The CLOB field is in the -cpinternal code page.
*/
DEFINE TEMP-TABLE ttab NO-UNDO
   FIELD name AS CHAR
   FIELD address AS CHAR
   FIELD city AS CHAR
   FIELD state AS CHAR
   FIELD fldClob as CLOB.

CREATE ttab.
COPY-LOB FROM file "clobfile.txt" TO fldClob
CONVERT SOURCE CODEPAGE "eucjis".