WHILE ctr_a_id <> MAXIMUM DO
INSERT INTO TBLA (TBL_A_ID) VALUES (ctr_a_id);
INSERT INTO TBLB (TBL_B_ID,TBL_A_ID) VALUES (ctr_b_id,ctr_a_id);
INSERT INTO TBLC (TBL_C_ID,TBL_B_ID) VALUES (ctr_c_id,ctr_b_id);
SET ctr_a_id = ctr_a_id +1;
SET ctr_b_id = ctr_b_id +1;
SET ctr_c_id = ctr_c_id +1;
The problem with this code is it generates a 1:1 mapping for TBL_A_ID to TBL_A_ID in the Child Tbl B and same way to TBL C.
i.e for tbl_a_id =1 there is only 1 tbl_b_id etc.
I am looking for a nested while statement or something similar which will allow me to create 10:100:1000 for tbles A B & C resp , is this possible in DB2?
Any thoughts methods?