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

SQL/MX Utilities
HP NonStop SQL/MX Reference Manual540440-003
5-36
Examples of import
You might specify the three import commands as:
C:\>import corpcat.persnl.employee -I empfile -C 2999 -T 500
C:\>import corpcat.persnl.employee -I empfile -C 1999 -F 3000
-T 500
C:\>import corpcat.persnl.employee -I empfile -C 1999 -F 5000
-T 500
The number of records for each partition must be less than or equal to the space
available in each partition, and the rows to be imported into each partition must
have an appropriate clustering key. In the preceding example, the first partition
allows for employee numbers ranging from 0 to 2999.
Run multiple instances of the import utility—one for each partition in the
destination table—to load data into a partitioned table by using a separate input file
for each partition. Each of the input files contains the data for each partition.
For example, you might specify the three import commands for the partitioned
EMPLOYEE table as:
C:\>import corpcat.persnl.employee -I empfile1 -T 500
C:\>import corpcat.persnl.employee -I empfile2 -T 500
C:\>import corpcat.persnl.employee -I empfile3 -T 500
Examples of import
Example 1 shows an import of data from a delimited file. 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 target table, COMPANY:
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"
Note. Check that the ranges specified are exact (for example, no gaps or omissions and
no overlap of rows).