Syntax for the character-position form

The syntax for the character-position form specifies information that includes the character position within a data row that starts a range of character positions and the character position that ends a range of character positions.

The following diagram shows the syntax of the character-position FILE statement.

1  FILE filename ( + , fieldn? + : start? -end?  NULL = ‘ null string ‘ )
Element Purpose Key Considerations
-end Indicates the character position within a data row that ends a range of character positions A hyphen must precede the end value.
fieldn Assigns a name to the data field that you are defining with the range of character positions None.
filename Specifies the name of the input file None.
null string Specifies the data value for which dbload must substitute a null value Must be a quoted string.
start Indicates the character position within a data row that starts a range of character positions. If you specify start without end, it represents a single character. None.

You can repeat the same character position in a data-field definition or in different fields.

The null string scope of reference is the data field for which you define it. You can define an explicit null string for each field that allows null entries.

Inserted data types correspond to the explicit or default column list. If the data-field width is different from its corresponding character column, inserted values are padded with blanks if the column is wider, or inserted values are truncated if the field is wider.

If the number of fields named is fewer than the number of columns in the table, dbload inserts the default value that is specified for the unnamed fields. If no default value 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 names, the default INSERT specification 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).

The syntax of dbload INSERT statements resembles INSERT statements in SQL, except that in dbload, INSERT statements cannot incorporate SELECT statements. The following diagram shows the syntax of the dbload INSERT statement for character-position form.

1  INSERT INTO?  owner .  table?  ( + , column )?  %VALUES clause(1)  ;
Notes:
Element Purpose Key Considerations
column Specifies the column that receives the new data None.
owner. Specifies the user name of the table owner None.
table Specifies the table that receives the new data None.

The syntax for character-position form is identical to the syntax for delimiter form.

The user who runs dbload with this command file must have the Insert privilege on the named table.