SQL/MX 2.x Reference Manual (G06.24+, H06.03+)

SQL/MX Utilities
HP NonStop SQL/MX Reference Manual523725-004
5-32
Examples of import
online dumps. After the import operation completes, you must perform a new TMF
online dump for all partitions of the table.
If multiple import processes are started on different partitions of a table without
indexes, the first import operation turns auditing off for all the partitions of the table. In
this scenario only the first import operation would benefit from the efficient insert
technique. A warning is issued for other import processes on the same table regarding
performance, as the table can be un-audited and non-empty.
If the table is not empty or has dependent indexes, import continues with the normal
load operation using TMF transactions.
Examples of import
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 COMPANY table:
CREATE TABLE company
( id INT NOT NULL
,company VARCHAR (176)
,phone VARCHAR (12)
,fax VARCHAR (12)
,PRIMARY KEY (id)
);
Data to Input
The input file, COINPUT, contains records like this:
1,"Test String 1","111-222-3333","222-333-4444"
2,"Test String 2","111-222-3333","222-333-4444"
3,"Test String 3","111-222-3333","222-333-4444"
4,"Test String 4","111-222-3333","222-333-4444"
5,"Test String 5","111-222-3333","222-333-4444"
6,"Test String 6","111-222-3333","222-333-4444"
7,"Test String 7","111-222-3333","222-333-4444"
8,"Test String 8","111-222-3333","222-333-4444"
Format File Describing the Data
Suppose that you want to import data into the COMPANY table from the fixed-width
and delimited COINPUT input file by using a format file. A format file, FORMFILE, is
created which consists of [DATE FORMAT], [COLUMN FORMAT], [DELIMITED
FORMAT] and [FIXED WIDTH FORMAT] sections:
[DATE FORMAT]
DateOrder=MDY