(Contents)(Previous)(Next)

Loading Several Tables in a Single Run

Several tables can be loaded from one source file in a single run. In this case, every target table must be described by a DATALOAD specification of its own.

Example:

DATALOAD TABLE customer IF POS 1 = 'c'

cno 02-05

name 07-16

city 18-37

state 38-39

zip 40-44

DATALOAD TABLE item IF POS 1 = 'i'

itno 02-09

descr 10-40

stock 41-44 INTEGER

min_stock 45-46 INTEGER

price 47-54 DECIMAL(2)

weight 55-58 REAL

INFILE ...

The source file records can be distributed among the target tables usingthe selection criterion. In the example above, the first column of the source file is used for distribution (punch card method).

If the criterion is missing for one of the target tables, each input record is selected for this table.

If several tables are loaded at the same time, then an individual INSERT statement is executed for each row. Otherwise, as many records are loaded at the same time as their lengths allow. Of course, single inserts take more time, but the error position can be determined for rejected records.If there is no other way to determine the cause of the error, two DATALOAD statements for the same table will force LOAD to execute single inserts reporting the error position


(Contents)(Previous)(Next)