SQL/MX 2.x Reference Manual (G06.24+, H06.03+)

SQL/MX Utilities
HP NonStop SQL/MX Reference Manual523725-004
5-29
Considerations for import
target column, you can specify two field delimiters with the appropriate number of
blanks between the delimiters.
Default Values for Delimited Data Input Files
For a delimited input file, if a column in the target table does not allow null, using two
consecutive field delimiters directs import to use the default value for the column
(instead of null for the column). For example, a column defined as NOT NULL might
have space as its default value. In this case, two consecutive field delimiters in the
corresponding input field specify space is to be stored in the target column.
Null Input Values for Fixed-Width Files
For a fixed-width input file, if a column in the target table allows null, you can specify a
null indicator character for that column in the input file. See [FIXED WIDTH FORMAT]
on page 5-26.
For example, suppose that the EMPLOYEE target table begins with the columns
EMPNUM, FIRST_NAME, MIDDLE_INITIAL, and LAST_NAME. Some employees
have no middle initial. You specify a hyphen (-) as the null indicator. As a result, the
input file contains records like this:
296 Mary -Smith 143 349080000.00
Null or Default Flag
For a delimited or fixed-width input file, if a column in the target table allows null or has
a default value, you can specify a null or default flag for that column in the input file.
The [COLUMN FORMAT] section of the format file indicates that this flag is used in the
input file. See [COLUMN FORMAT] on page 5-26.
These column definitions, for example, allow these insert values:
Two-Digit Year Input Values for Input File
You have the option of specifying a two-digit year date or timestamp value in the [DATE
FORMAT] section of a format file. If you do and the year value is less than 30, import
assumes the first two digits of the year to be 20. If the year value is greater than or
equal to 30, import assumes the first two digits of the year to be 19.
Data Types of Input Values for Input File
Column Definition Insert Value
NOT NULL NO DEFAULT Input value must be provided. Null or default value is
not allowed.
NOT NULL DEFAULT 'abc' If flag is D, default value is inserted. Otherwise, input
value is inserted. Null is not allowed.
NO DEFAULT If flag is N, null is inserted. Otherwise, input value is
inserted. Default value is not allowed.
DEFAULT 'abc' If flag is D, default value is inserted. If flag is N, null is
inserted. Otherwise, input value is inserted.