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

SQL/MX Utilities
HP NonStop SQL/MX Reference Manual540440-003
5-38
Examples of import
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
col=fax,48,12
RecordLength=61
All commas and double-quote characters in the input file are ignored because they
are not covered by any of the col= entries in the [FIXED WIDTH FORMAT] section
of the format file. Also, in this example the RecordLength value of 61 includes one
newline character at the end of each input record.
import Load Command
This import command imports data into the COMPANY table from the fixed width
input file named COINPUT_FX using the format file FORMFILE:
import cat.sch.COMPANY -i COINPUT_FX -u FORMFILE -w FIXED
Example 3 shows an import into TABLE_2 from a fixed width file with data that is
not separated by double-quote characters. This example shows the schema of the
table to be loaded, the data to be loaded (the input data file), the format file
describing the data, and the import command used to load it.
Table Schema
This statement creates the TABLE_2 table:
CREATE TABLE table_2
(COL1 CHAR(5)
);
Data to Input
The input file, COINPUT_FX2, contains records like this:
0123456789012345
ABCDEFGHIJKLMNPQ
0123456789012345
Three hidden spaces are at the end of each line.
Format File Describing the Data
[DATE FORMAT]
NormalizeDate = y
[COLUMN FORMAT]
col=col1
[FIXED WIDTH FORMAT]
FileIsBinary=N