Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site

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 description header start identifier.
escape mode
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'
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'
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'
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
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.
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:

 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:

Escape character sequence
Usage Description
\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.
\u (lower case letter 'u')
Preceding a unicode value. A Unicode value is assumed to be eight HEX value digits, i.e. 0-F.
\- (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
Mimer SQL Documentation TOC PREV NEXT INDEX