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 Guide—544536-007
10-35
Examples of Using import to Load an SQL/MX Table
col=fax,48,12
RecordLength=61
import Load Command
This import command imports data into the target table COMPANY from the fixed
width input file COINPUT_FX using the format file FORMFILE2:
import cat.sch.company -i COINPUT_FX -u FORMFILE2 -w FIXED
Example 3: Importing Data From a Fixed Width File Not
Separated by Double-Quote Characters
This example is of an import from a fixed width file with data that is not separated by
double-quote characters. It shows the structure 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 Structure
This statement creates the target table, TABLE_2:
CREATE TABLE table_2
(COL1 CHAR(5)
);
Data to Input
The input file, COINPUT_FX2, contains records like this:
0123456789012345
ABCDEFGHIJKLMNPQ
0123456789012345
Note that there are three hidden spaces and a newline character at the end of each
line.
Format File Describing the Data
Create a format file, FORMFILE3, which consists of [DATE FORMAT], [COLUMN
FORMAT], and [FIXED WIDTH FORMAT] sections:
[DATE FORMAT]
NormalizeDate = y
[COLUMN FORMAT]
Note. 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. In this example, the RecordLength value of 61 includes one newline character at the end
of each input record.










