SQL/MX 3.2 Reference Manual (H06.25+, J06.14+)
SQL/MX Utilities
HP NonStop SQL/MX Release 3.2 Reference Manual—691117-001
5-58
Considerations for import
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-54.
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-54. For details about importing into
nullable columns, see import and Nullable Columns on page 5-61.
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
import converts the character data in the input file to the appropriate data types as
defined in the target table. The data types of the values in an input record must be
compatible with the data types of the columns in the destination table.
Use the -Z option to specify the character set for the data being imported. import will
import data in a UCS2 input file to any noncharacter-typed column after a
Unicode-to-ISO88591 conversion, and to a character-type column through a
conversion that translates the Unicode data to the character set of the column. import
will directly import UCS2 data to UCS2 columns without conversion.
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.










