Sie sind auf Seite 1von 1

LOAD command

Loads data into a DB2® table. Data stored on the server can be in the form of a file,
tape, or named pipe. Data stored on a remotely connected client can be in the form of a
fully qualified file or named pipe. Data can also be loaded from a user-defined cursor or
by using a user-written script or application. If the COMPRESS attribute for the table is set
to YES, the data loaded is subject to compression on every data and database partition
for which a dictionary exists in the table.
REPLACE
One of four modes under which the load utility can execute. Deletes all existing
data from the table, and inserts the loaded data. The table definition and index
definitions are not changed. If this option is used when moving data between
hierarchies, only the data for an entire hierarchy, not individual subtables, can
be replaced.
INTO table-name
Specifies the database table into which the data is to be loaded. This table
cannot be a system table or a declared temporary table. An alias, or the fully
qualified or unqualified table name can be specified. A qualified table name is in
the form schema.tablename. If an unqualified table name is specified, the
table will be qualified with the CURRENT SCHEMA.

IMPORT Command
Inserts data from an external file with a supported file format into a table, hierarchy, view
or nickname. LOAD is a faster alternative, but the load utility does not support loading
data at the hierarchy level.
INSERT
Adds the imported data to the table without changing the existing table data.
INTO table-name
Specifies the database table into which the data is to be imported. This table
cannot be a system table, a declared temporary table or a summary table.

One can use an alias for INSERT, INSERT_UPDATE, or REPLACE, except in


the case of a down-level server, when the fully qualified or the unqualified table
name should be used. A qualified table name is in the form: schema.tablename.
The schema is the user name under which the table was created.
REPLACE
Deletes all existing data from the table by truncating the data object, and inserts
the imported data. The table definition and the index definitions are not
changed. This option can only be used if the table exists. If this option is used
when moving data between hierarchies, only the data for an entire hierarchy,
not individual subtables, can be replaced.

This option does not honour the CREATE TABLE statement's NOT LOGGED
INITIALLY (NLI) clause or the ALTER TABLE statement's ACTIVE NOT
LOGGED INITIALLY clause.

If an import with the REPLACE option is performed within the same transaction
as a CREATE TABLE or ALTER TABLE statement where the NLI clause is
invoked, the import will not honor the NLI clause. All inserts will be logged.

Das könnte Ihnen auch gefallen