Runnig multiple SQL statment in DB2 stage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
murur
Participant
Posts: 19
Joined: Wed Apr 14, 2004 7:55 am

Runnig multiple SQL statment in DB2 stage

Post by murur »

I have to implement the following scenario,

1) Step 1: select list of emp_no from <TABLE1>
...
....
...
n) Last Step : I have to run multiple SQL statment against various
tables in one database in DB2 Stage (using DB2/UDB API plug in)

Ex:
insert into <TABLE2> VALUES (emp_no,......)
delete from <TABLE4> where emp_no = <list of EmpNo selected in step1>
delete from <TABLE5> where emp_no = <list of EmpNo selected in step1>

Question is : What are all option I have to implement the above scenario.
(As per standard I shouldn't create any DB procedure, all code should reside in DataStage job only).

Thank you,
Muru
:)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I'd recommend separate DataStage jobs for each step. The results of Step 1 are stored in a file (text file, hashed file, doesn't really matter) which becomes the input for Step 4 and Step 5. You didn't specify what Step 2 and Step 3 do, it may be needed there too.
Wrap a job sequence around the lot, so that everything depends on successful execution of Step 1, and there you have it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply