SQL/MX 2.x Reference Manual (H06.10+, J06.03+)

SQL/MX Utilities
HP NonStop SQL/MX Reference Manual544517-008
5-53
Examples of import
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
RecordLength =5
col=col1,1,5
import Load Command
This import command imports data into the table_2 table from the delimited input
file named COINPUT using the format file FORMFILE:
import cat.sch.table_2 -I coinput_fx2 -U formfile -W FIXED
Example 4 illustrates how to use new options and analyze the output files.
Table Schema
This statement creates the target table, cat.sch.Xample:
CREATE TABLE cat.sch.Xample
( C1 int NOT NULL PRIMARY KEY
, C2 char(8) NOT NULL
, CONSTRAINT cnd1 CHECK (c1 > 5)
);