my requirement:
i have to generate a flat file from some simple Table1. then i need to insert into Table2 a record for every record from Table1 that was exported (Table2 is kind of a status table). so the steps would be:
#1. EXPORT TO (that includes a SELECT from Table1)
#2. UPDATE Table2 with PK of Table1 as foreign
for doing #2, i need to store the PKs from the SELECT statement into some (sqltable)variable. using Stored Procedures, this must be simple. but Stored Procedures do not allow the EXPORT statement in them. i know there must be some easy way of doing this but i am simply new to databases, especially db2. can someone please help?!
thanks very much.
i have to generate a flat file from some simple Table1. then i need to insert into Table2 a record for every record from Table1 that was exported (Table2 is kind of a status table). so the steps would be:
#1. EXPORT TO (that includes a SELECT from Table1)
#2. UPDATE Table2 with PK of Table1 as foreign
for doing #2, i need to store the PKs from the SELECT statement into some (sqltable)variable. using Stored Procedures, this must be simple. but Stored Procedures do not allow the EXPORT statement in them. i know there must be some easy way of doing this but i am simply new to databases, especially db2. can someone please help?!
thanks very much.