OCI 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
Suparv
Participant
Posts: 17
Joined: Wed Aug 25, 2004 9:33 am
Location: Pennsylvania

OCI STAGE

Post by Suparv »

Hi

I have 2 jobs which are linked.
records in Job1 are the parameters to job 2. So Job 2 runs as many times as there are records in job 1.

Ex: if there are 2 records in Job1, then Job2 would would run 2 times, each time taking one record in Job1 as its parameters.

The target table in job 2 has to be set in such a way that it should get truncated only when the first record in job 1 is taken as parameters.
If I use the Update action 'Truncate table then insert rows', the table gets truncated for each record in Job1.

is there a way to get this done?
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

You need to do it in a before job routine. So it would need to pass in an argument which would tell it to truncate the table or not. This should be controled by a parameter. Pretty simple routine. I would put the sql to run in a text file and use sqlplus in a shell script to execute. Ray and others have posted the syntax to execute this shell script. If you cannot find the posts then ask again based on what you still need to know. You should be able to figure out most of this.
Mamu Kim
Suparv
Participant
Posts: 17
Joined: Wed Aug 25, 2004 9:33 am
Location: Pennsylvania

Post by Suparv »

Thanks a lot

it worked....
Post Reply