Data Description Headers and Files
Data description headers and files are used to describe the data that follows.
The following table describes data description header elements:
#data Required Data description header start identifier. escape mode Optional Indicates that the data is escaped, i.e. that some elements of the data are tagged for secure recognition at LOAD.See the table below. When using UNLOAD, data escape mode is always used. column separator 'x' Optional Indicates which character is the column separator when reading the data.The default is the comma character (,).If this option is not used, LOAD assumes that the comma character is the column separator. text qualifier 'x' Optional Indicates which character is the qualifier for text strings in the data.The default is the double quote character (").If this option is not used, LOAD assumes the double quote character as the text qualifier or unqualified data. null indicator 'x' Optional Indicates which character is the NULL value if found in a data field.If this option is not stated, LOAD assumes the empty string, i.e. two consecutive column separators, as a NULL value.In data escape mode, '\-' is treated as the NULL value. using insert-statement Optional The SQL INSERT statement that indicates where, and in what way, data should be loaded.This statement is used in the situation where the LOAD statement itself does not include a USING clause. ; Required Data description header end identifier.
As shown in the table above, the characters used to specify column separators, text qualifiers and NULL indicators must be enclosed in single quotes. If you use a single quote to specify a column separator, text qualifier or NULL indicator, you must enter it twice, for example, you would specify a single quote as a column separator as ''''.
Data Description Header Examples
For data unloaded from a Mimer SQL database using UNLOAD, the data description header generated could look as follows:#data escape mode using insert into t (c) values (?);
The example above implies the following for LOAD: the column separator is the comma character (default). Text strings are presumed to be unqualified or qualified with the double quote character. Data escaping is assumed (see the table below). The USING statement in the header will be used if no USING clause is given in the LOAD statement.
The following is another example of a data description header where all optional elements mentioned above, except data escape mode, are used:#data column separator ':' text qualifier '!' null indicator '§' using insert into t1 (c1,c2,c3) values (?,?,?);
In the example above, the table t1 and the columns c1, c2 and c3 are supposed to exist when starting the data load. Specific characters for column separator, text qualifier and null indicator are defined.
Escape Character Sequences
If data escape mode is specified, the back-slash character (\) is used as the escape character. The character following the escape character can be one of 'x', 'u', '-' or '_'. See the following table for a description of valid escape character sequences:
\x (lower case letter 'x') Preceding a hexadecimal byte value. A HEX value is assumed to be two HEX value digits, i.e. 0-F. \x1A \u (lower case letter 'u') Preceding a unicode value. A Unicode value is assumed to be eight HEX value digits, i.e. 0-F. \u12345678 \- (dash) Null value \- \_ (underscore) End of table, including end of stream or file \_
Note: If you do not use data escape mode, end of file is treated as end of table. This means that such a data file only can contain data for one table.
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40