You are on page 1of 1

60 Chapter 2: Inserting

n ORDER OFF suppresses the sorting of the input file when a table with a
clustered index is being loaded. This will speed up LOAD TABLE if the
input is already sorted by the clustered index column values. The default is
ON, to sort the input if there is a clustered index defined.
n PCTFREE specifies the amount of free space to be left in each page as
LOAD TABLE inserts rows. The amount is expressed as a percentage in
the range 0 to 100; it overrides the PCTFREE value specified in the
CREATE TABLE, if any, but only for the duration of the LOAD TABLE
statement. For more information about PCTFREE, see Section 1.12, Free
Space.
n QUOTES OFF specifies that all string input values are to be treated as
unquoted, regardless of whether or not they are actually surrounded by
quotes; in other words, quotes are stored as part of the data no matter where
they appear. It also specifies that leading spaces will not be removed from
unquoted input strings, except for blank input fields, which are always
treated as empty strings. The default behavior, QUOTES ON, is to remove
the quotes surrounding quoted input values; the details are described later
in this section.
n STRIP OFF specifies that trailing spaces in unquoted string input values
will not be removed. The default is ON, to strip trailing quotes from
unquoted string values. Quoted string values are not affected by either set-
ting. Note that leading spaces are affected by the QUOTES option, not
STRIP.
n WITH CHECKPOINT ON specifies that a checkpoint operation will be
automatically carried out when the LOAD TABLE finishes. This guaran-
tees that all the new rows are written to the physical database file; that may
be important to you because LOAD TABLE doesnt write the new rows to
the transaction log. The default is OFF, dont bother taking a checkpoint.

Tip: Be careful coding the DELIMITED BY option. Pretty much any string value
will be accepted, including 'x09' which is an x followed by a zero and a nine. If
you want the tab character, dont forget the escape character: DELIMITED BY
'\x09'.

The rules for handling missing input values are fairly complex, and difficult to
explain clearly in plain English, so heres a bit of pseudocode to describe how a
single value for a single column is handled:
IF this column has been omitted from an explicit LOAD TABLE input name list
OR the field on this input record corresponding to this column is empty
THEN
IF this column has no DEFAULT value in the CREATE TABLE
OR the LOAD TABLE DEFAULTS option is OFF
THEN
IF this column accepts NULL values
THEN
The NULL value will be used.
ELSE
An attempt will be made to convert the empty string '' to the column's
data type and use that value; this process will assign zero to numeric and
BIT columns, and the empty string to character and binary columns, but it
will fail with an error message for DATE, TIME, and TIMESTAMP columns.

You might also like