inserts into oracle stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
pavan_test
Premium Member
Premium Member
Posts: 263
Joined: Fri Sep 23, 2005 6:49 am

inserts into oracle stage

Post by pavan_test »

Hi All,

I have a oracle stage.
it has to do insert records into the table.


for i in 1..number of levels loop
do the insert into the table
end loop,

note: the number of levels is parameter which will be passed
at run time.
eg : if the number of levels is 3 then records will
inserted into the table 3 times ( it is a requirement.)

can anyone please suggest me how can I accomplish this in oracle stage.
i am using datastage 7.5.1 and OS is unix.

thanks
pavi
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

So if i have understood your requirement correctly, the number of times a particular record will be inserted will depend upon a parameter value.
Correct?
A couple of ways,
-look into the start loop and end loop activity in a sequence job. Run the same job n number of times
-build your load ready file, cat it n number of time together, redirect the output to another file and use the new file as a single load into the table

I am sure others have more ways, but those are a few from me.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Post by sud »

DSguru2B wrote:So if i have understood your requirement correctly, the number of times a particular record will be inserted will depend upon a parameter value.
Correct?
A couple of ways,
-look into the start loop and end loop activity in a sequence job. Run the same job n number of times
-build your load ready file, cat it n number of time together, redirect the output to another file and use the new file as a single load into the table

I am sure others have more ways, but those are a few from me.
I think using the loop activity will be the simplest as well as the most effective way of achievinh this.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can not write loops in the Oracle stage itself. Therefore you basically have two choices; use Start Loop and End Loop activities in a job sequence, as the others have suggested, or use an Oracle stored procedure.
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