Bulk loading data using the LOAD TABLE statement
176
Using command files
to load data
To load large amounts of data, most users create command files. To create a
command file, follow the instructions in the chapter entitled “Getting Started
with DBISQL” in the Introduction to Adaptive Server IQ.
Transaction
processing and LOAD
TABLE
When you issue the LOAD TABLE statement for an IQ table, a savepoint occurs
automatically before the data is loaded. If the load completes successfully,
Adaptive Server IQ releases the savepoint. If the load fails, the transaction rolls
back to the savepoint. This approach gives you flexibility in committing
transactions. For example, if you issue two
LOAD TABLE commands, you can
ensure that either both commit or neither.
When you issue
LOAD TABLE for a Catalog Store table, there is no automatic
savepoint. If the load succeeds, it commits automatically. If the load fails, it
rolls back. You cannot roll back a successful load of a Catalog Store table.
For more information on transaction processing, see Chapter 8, “Transactions
and Versioning”.
Summary of LOAD
TABLE syntax
The basic form of the LOAD TABLE statement is:
LOAD TABLE [
owner
].
table-name
[ (
load
-
specification
, ... ) ]
FROM ’
filename
-
string
’, ...
[ FORMAT { ’ascii’ | ’binary’ } ]
... [ DELIMITED BY
string
]
... [ STRIP { ON | OFF } ]
... [ QUOTES { ON | OFF } ]
... [ ESCAPES { ON | OFF } ]
[ ESCAPE CHARACTER character ]
[ WITH CHECKPOINT ON|OFF ]
... [
load-options
]
Load specification
The load-specification does the following:
• Lists each column to be loaded and describes the data in it. A column can
contain fixed-length data, variable-length characters delimited by a
separator, or data that uses a binary prefix to represent the number of bytes
being read.
• Specifies
FILLER format for any fields you want to skip.
The syntax for load-specification is as follows:
load-specification
:
{
column-name
[
column-spec
] |
FILLER (
filler-type
) }