DB2 Novice wrote:
I am trying to use DB2 Control Centre (version 8.2) to load one flat
file into multiple tables. However, I don't see the options in Control
Centre that allows that.
Anyone knows how to do this?
DB2 Novice
In one shot using load.. No.
How do you distribute the data. Do you parition vertically (column 1 - n
to T1, rest to T2) or horizontally (some rows to T1 some rows to T2).
There are multiple options:
For vertical partitioning the simplest approach would be to just use two
LOAD commands
For horizontal partitioning I woudl load the fiel into a staging table
and then either run two loads from cursor or, if you want only one scan:
BEGIN ATOMIC
FOR row AS SELECT * FROM staging DO
INSERT INTO T1 SELECT * FROM TABLE(VALUES(row.c1, ...)) AS S WHERE
<cond1>;
INSERT INTO T2 SELECT * FROM .... <cond2>;
END
%
Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab