SQL/MX 2.x Installation and Management Guide (H06.04+)
Reorganizing SQL/MX Tables and Maintaining Data
HP NonStop SQL/MX Installation and Management Guide—540436-001
10-32
Examples of Using import to Load an SQL/MX Table
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
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)
);
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.










