Utilities 7-29
How to Create a Command File
The restrictions dbload imposes on the VALUES clause value list affect only
data types DATE, DATETIME, and INTERVAL. Values of type DATE must be in
mm/dd/yyyy format. (This is the case if the DBDATE environment variable is
set to its default value, MDY4/.) Data for DATETIME and INTERVAL columns
must be in character form, showing only field digits and delimiters (no type
or qualifiers).
Inserted data types correspond to the explicit or default column list. If the
data field width is different from its corresponding character column width,
the data is made to fit. That is, inserted values are padded with blanks if the
data is not wide enough for the column, or are truncated if the data is too
wide for the column.
If the number of columns named is fewer than the number of columns in the
table, dbload inserts the default value specified for the unnamed columns. If
no default is specified, dbload attempts to insert a null value. If the attempt
violates a NOT NULL restriction or a unique constraint, the insert fails and an
error message is returned.
If the INSERT statement omits the column name(s), the default INSERT speci-
fication is every column in the named table. If the INSERT statement omits the
VALUES clause, the default INSERT specification is every field of the previous
FILE statement.
An error results if the number of column names listed (or implied by default)
does not match the number of values listed (or implied by default).
Character-Position Statement Examples
The first FILE and INSERT statement set in the character-position example on
page 7-26 is repeated here:
FILE cust_loc_data
(city 1-15,
state 16-17,
area_cd 23-25 NULL = "xxx",
phone 23-34 NULL = "xxx-xxx-xxxx",
zip 18-22,
state_area 16-17 : 23-25);
INSERT INTO cust_address (col1, col3, col4)
VALUES (city, state, zip);