SQL/MX 2.x Reference Manual (G06.24+, H06.03+)
SQL/MX Utilities
HP NonStop SQL/MX Reference Manual—523725-004
5-30
Considerations for import
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 non character 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.
Format and data file requirement for Unicode import
A UCS2 data input file must be in UTF-16BE (UTF-16 big-endian) or UTF-16LE
(UTF-16 little-endian) format. The byte order mark (BOM) must occupy the first two
bytes of the input file.
Because the format file or the import command line is specified in ASCII, the field
delimiter, the field qualifier, or the row delimiter character in a UCS2 input data file,
must be the ASCII-equivalent version. For example, the field delimiter ',' (ASCII value
0x2C) for an Unicode data file must be supplied in Unicode 0x002C.
If the Unicode datafile is subjected to a fixed width format importing, the unit for the
start position and the length of input fields in the COL attribute, and the record length in
the RecordLength in the FIXED width format section is in characters, not in bytes.
Error Reporting for Unicode import
Error messages sent to the console remain in ASCII. If UCS2 data is to be included in
the message, its content is converted first. All UCS2 characters in the range [0x00.
0xFF] are converted to 8-bit ASCII equivalent. For all other UCS2 characters, NonStop
SQL/MX uses the hexadecimal form of their code values. import inserts a space
before and after the hexadecimal value for readability.
Error rows logged to the error log file are in UCS2, in the same byte order as the
source data file. You can resubmit the log file to import after errors have been
corrected.
If a character in the data file cannot be translated into one required by the target
column, NonStop SQL/MX issues an error. Importing an UCS2 data file into an
ISO88591 column with character's code values beyond the range of ISO88591 will
lead to this translation error condition.
Datetime and Interval Data for Input File
For datetime and interval data, do not specify keywords that are part of the data type in
the column definition.
For example:
•
If the datetime value to be imported is DATE '1990-01-22', specify the field
without the keyword in the input data file as:
1990-01-22