


A command file can contain SQL statements and LOAD statements as well as input data for load statements. The statements must be separated from each other by separator lines.
The following general structure of a command file is recommended for performance reasons:
1. CREATE TABLE statements
2. DATALOAD statements
3. Other DDL statements such as CREATE INDEX
Separator lines begin with '/' or '*' in the first position.
After these symbols, the lines may contain comments which LOAD will ignore.
Example of a command file:
* *****************************************************
* Defines the two tables CUSTOMER and RESERVATION
* Loading tables from the file VYECRES.DATA
* Reading in updates from the file VUPCRES.DATA
*
CREATE TABLE reservation
( rno FIXED (4) KEY RANGE BETWEEN 1 AND 9999,
cno FIXED (4) NOT NULL RANGE BETWEEN 1 AND 9999,
hno FIXED (4) NOT NULL RANGE BETWEEN 1 AND 9999,
arrival DATE,
departure DATE,
price FIXED (6,2) RANGE BETWEEN 0 AND 1000)
*
CREATE TABLE customer
( cno FIXED (4) KEY RANGE BETWEEN 1 AND 9999,
title CHAR (2) RANGE IN ('Mr','Ms'),
firstname CHAR (10),
name CHAR (10) NOT NULL,
city CHAR (20) NOT NULL,
state CHAR (2) NOT NULL,
zip FIXED (5) NOT NULL RANGE BETWEEN 1 AND 99999,
account FIXED (7,2) RANGE BETWEEN -10000 AND 10000)
*
DATALOAD TABLE customer IF POS 1-2 = 'cs'
cno 4-8
title 10-12 NULL IF POS 16-18 = '---'
name 29-40
city 42-61
state 62-63
zip 64-68
account 70-78
DATALOAD TABLE reservation IF POS 1-2 = 'rs'
rno 4-8
cno 10-14
hno 16-19
arrival 42-49
departure 51-58 NULL IF POS 51-53 = '---'
price 60-68
INFILE vyecures.data
*
DATAUPDATE TABLE reservation IF POS 1-2 = 'rs'
KEY rno 4-8
SET hno 25-28
SET departure 51-58 NULL IF POS 51-53 = '---'
INFILE vupcures.data
*******************************************************


