DELIMITER Clause

 

Default delimiter symbol is pipe (|). This default setting can be changed by means of the DELIMITER clause if the LOAD statement. The DELIMITER clause is optional. The delimiter sign must terminate an input record only if the last value of this record is NULL.

 

Below is an example of the LOAD statement with the DELIMITER clause which sets the caret (^) symbol as the delimiter:

 

LOAD FROM "/source/unl/ins_info" DELIMITER "^" INSERT INTO cust_info

 

The ins_info file will contain such input records:

 

0^Smith^John^Male^^Canada

0^Brown^Anna^Felame^(432)231-65-30^^

 

If the DELIMITER clause is omitted, the delimiter symbol is defined by the DBDELIMITER environment variable, if it is set, otherwise the default delimiter symbol pipe (|) is used.

The following symbols cannot serve as delimiters:

 

The backslash (\) serves as an escape character that indicates that the character that follows the backslash should be interpreted literary and not as a delimiter symbol or escape character. If a character value includes the NEWLINE symbol or a delimiter symbol without backslash symbol, an error will occur. It is advisable that you use the LOAD statement within a transaction if your database supports explicit transactions, otherwise it would be difficult to recover the database after such error.

 

A backslash is automatically inserted by the UNLOAD statement before any literal delimiter or a literal NEWLINE symbol when the data are copied from a table into a file. These backslashes are removed by the LOAD statement, when the data are inserted into a table.