ESCAPES option

Bulk loading data using the LOAD TABLE statement

Example

Specifying load options

STRIP option With STRIP turned on (the default), trailing blanks are stripped from values before they are inserted. This is effective only for VARCHAR data. To turn the STRIP option off, enter the clause as follows:

...STRIP OFF ...

Trailing blanks are stripped only for non-quoted strings. Quoted strings retain their trailing blanks. If you don’t require blank sensitivity, you may use the FILLER option allows you to be more specific in the number of bytes to strip instead of just all the trailing spaces.

This option does not apply to ASCII fixed-width inserts. For example, the STRIP option in the following statement is ignored:

LOAD TABLE dba.foo (col1 ascii(3), col2 ascii(3)) FROM foo_data QUOTES OFF ESCAPES OFF STRIP ON

QUOTES option Currently, you must specify QUOTES OFF. With quotes off, Adaptive Server IQ does not strip off apostrophes (single quotes) or quotation marks (double quotes). When it encounters these characters in your input file, it treats them as part of the data.

With quotes off, you cannot include column delimiter characters in column values.

Currently, you must specify ESCAPES OFF. The default of ESCAPES ON is provided for compatibility with Adaptive Server Anywhere; this option may be supported in a future version. With ESCAPES turned on, if you omit a column-spec definition for an input field, characters following the backslash character are recognized and interpreted as special characters by the database server. Newline characters can be included as the combination \n, and other characters can be included in data as hexadecimal ASCII codes, such as \x09 for the tab character. A sequence of two backslash characters ( \\ ) is interpreted as a single backslash.

The following UNIX example specifies a BLOCK FACTOR of 50,000 records along with the PREVIEW option:

LOAD TABLE lineitem (l_shipmode ASCII(15), l_quantity ASCII(8), FILLER(30))

FROM ’/d1/MILL1/tt.t’

BLOCK FACTOR 50000 PREVIEW ON

You can specify a wide range of load options. These options tell Adaptive Server IQ how to interpret and process the input file, and what to do when errors occur.

180

Page 200
Image 200
Sybase 12.4.2 manual 180