Page 1 of 1

inserts into oracle stage

Posted: Fri Jun 30, 2006 9:45 am
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

Posted: Fri Jun 30, 2006 9:51 am
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.

Posted: Fri Jun 30, 2006 12:45 pm
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.

Posted: Fri Jun 30, 2006 4:30 pm
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.