## SQLWays - IBM DB2 LOAD Command

This chapter describes the IBM DB2 LOAD utility, which moves data from files, named pipes, or devices into a DB2 table.

The load utility is capable of efficiently moving large quantities of data into tables. The utility can handle all data types, including large objects (LOBs) and user-defined types (UDTs). The load utility is faster than the import utility, because it writes formatted pages directly into the database, while the import utility performs SQL INSERTs. The load utility does not fire triggers, and does not perform referential or table constraints checking (other than validating the uniqueness of the indexes).

- LOAD Command Options

#### LOAD Command Options

Syntax

     LOAD [CLIENT] FROM filename | pipename | device OF filetype
       LOBS FROM lobpath MODIFIED BY filetype_mod METHOD load_method
      [SAVECOUNT n] [ROWCOUNT n] [WARNINGCOUNT n] [MESSAGES message_file]
       INSERT | REPLACE | RESTART | TERMINATE INTO table_name [(column {, column})]

Options

- CLIENT - Specifies that the data to be loaded resides on a remotely connected client. If this option is not specified the data must reside on the server.

  The CLIENT option is available in DB2 7.1 or later.

Example

This example uses the LOAD command to load an ASCII text file to a DB2 table.

     LOAD FROM customers.txt OF del MESSAGES customers.log INSERT INTO customers

[Main] [Table of Contents]
Copyright © 1999-2003 Ispirer Systems. All Rights Reserved.
SQLWays™ www.ispirer.com.