SQL/MX 2.x Installation and Management Guide (H06.10+, J06.03+)

Reorganizing SQL/MX Tables and Maintaining Data
HP NonStop SQL/MX Installation and Management Guide544536-007
10-34
Examples of Using import to Load an SQL/MX Table
RowDelimiter=\n
Qualifier="
import Load Command
This import command imports data into the target table COMPANY from the delimited
input file COINPUT using the format file FORMFILE1:
import cat.sch.company -I coinput -U formfile1 -W DELIM
Example 2: Importing Data From a Fixed Width File
This example of an import from a fixed width file 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
Create a format file, FORMFILE2, which consists of [DATE FORMAT], [COLUMN
FORMAT], and [FIXED WIDTH 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
[FIXED WIDTH FORMAT]
col=id,1,11
col=company,14,16
col=phone,33,12