SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Utilities
HP NonStop SQL/MX Reference Manual540440-003
5-37
Examples of import
7,"Test String 7","111-222-3333","222-333-4444"
8,"Test String 8","111-222-3333","222-333-4444"
Format File Describing the Data
Create a format file, FORMFILE, which consists of [DATE FORMAT], [COLUMN
FORMAT], and [DELIMITED FORMAT] sections:
[DATE FORMAT]
DateOrder=MDY
DateDelimiter=/
TimeDelimiter=:
FourDigitYear=Y
DecimalSymbol=.
[COLUMN FORMAT]
col=id,N
col=company,N
col=phone,N
col=fax,N
[DELIMITED FORMAT]
FieldDelimiter=,
RowDelimiter=\n
Qualifier="
import Load Command
This import command imports data into the COMPANY table from the delimited
input file named COINPUT using the format file FORMFILE:
import cat.sch.company -I coinput -U formfile -W DELIM
Example 2 shows an import into the same COMPANY table from a fixed width file.
This example shows the data to be loaded (the input data file), the format file
describing the data, and the import command used to load it.
Data to Input
The input file, COINPUT_FX, contains records like this:
00000000001,"Test String 3456","111-222-3333","444-555-6666"
00000000002,"ibm ","408-111-2222","408-222-3333"
00000000003,"apple ","408-222-1111","408-333-2222"
00000000004,"tandem ","408-285-5000","408-285-2227"
00000000005,"diyatech ","510-111-2222","510-222-3333"
Format File Describing the Data
[DATE FORMAT]
DateOrder=MDY
DateDelimiter=/
TimeDelimiter=:
FourDigitYear=Y
DecimalSymbol=.
[COLUMN FORMAT]