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

SQL/MX Utilities
HP NonStop SQL/MX Reference Manual523725-004
5-28
Considerations for import
You can use a field qualifier to ensure that the comma (,) is included in this field. You
are not required to use a field qualifier for other fields in the row. For example:
135,"Jackson,Jane",100 East St.,Cupertino,CA,95014
If your field data contains default field qualifier of single quote ("), enclose this field data
within field qualifiers. For example:
135,"Re: "Meeting Request" subject", 01-JUL-1985
If the data is enclosed within field qualifiers, HP recommends that you use a unique
multicharacter string as a field delimiter that can be distinguished from the enclosed
data.
Using a Field Delimiter
Use field delimiters to separate field data for a record. The default field delimiter
character is a comma (','). HP recommends that you use a unique multicharacter field
delimiter string that is not part of enclosed or nonenclosed field data. For example:
135|*| "Re: "Meeting Request|*|" subject" |*| 01-JUL01985
In this example, the field delimiter used is part of the data. When import processes
this type of data, as soon as it encounters the first |*| in the data that corresponds to
the second field, it is treated as field delimiter. import then processes the data
following this first |*| as next field data, and so on through the data. Therefore, in this
example, the column count of the data is considered to be more than the table column
count.
Row or Record Delimiters
The new line character (\n) is typically used as a record delimiter in an input data file. If
a new line character already exists in an input file as a record delimiter, you cannot
specify and include a different record delimiter in the file. If you do, import interprets
the new line character as part of a data field.
Under some circumstances, you might want to include a new line character as part of a
data field. For example, suppose that you have data that is to be used as printed text,
and the new line character is included in the data for the purpose of formatting. Then
you must specify a record delimiter other than the new line character.
Null Input Values for Delimited Data Input Files
For a delimited input file, if a column in the target table allows null, you can specify null
for that column in the input file. Two consecutive field delimiters specify null.
For example, suppose that the EMPLOYEE target table begins with the columns
EMPNUM, FIRST_NAME, MIDDLE_INITIAL, and LAST_NAME. The MIDDLE_INITIAL
column allows null. Some employees have no middle initial. As a result, the input file
contains records like this:
2961,Mary,,Smith,143,3490,80000.00
If you want to insert null in a nullable target column, you can specify two consecutive
field delimiters as shown in the preceding example. If you want to insert blanks in the