Command file for the dbload utility
Before you use the dbload utility, you must create a command file that names the input data files and the tables that receive the data. The command file maps fields from one or more input files into columns of one or more tables within your database.
The command file contains only FILE and INSERT statements. Each FILE statement names an input data file. The FILE statement also defines the data fields from the input file that are inserted into the table. Each INSERT statement names a table to receive the data. The INSERT statement also defines how dbload places the data that is described in the FILE statement into the table columns.
- Delimiter form
- Character-position form
The FILE statement has a size limit of 4,096 bytes.
Use the delimiter form of the FILE statement when every field in the input data row uses the same delimiter and every row ends with a new-line character. This format is typical of data rows with variable-length fields. You can also use the delimiter form of the FILE statement with fixed-length fields as long as the data rows meet the delimiter and new line requirements. The delimiter form of the FILE and INSERT statements is easier to use than the character-position form.
Use the character-position form of the FILE statement when you
cannot rely on delimiters and you must identify the input data fields
by character position within the input row. For example, use this
form to indicate that the first input data field begins at character
position 1
and continues until character position 20
.
You can also use this form if you must translate a character string
into a null value. For example, if your input data file uses a sequence
of blanks to indicate a null value, you must use this form if you
want to instruct dbload to substitute null at every occurrence
of the blank-character string.
You can use both forms of the FILE statement in a single command file. For clarity, however, the two forms are described separately in sections that follow.