Truncate table

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
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

Truncate table

Post by dodda »

Hello,

I have a requirement where in the sequence my first job would be to delete all the records from the table and the second job would load the data.

Is there a way that i can truncate the table as part of my first job rather than delete. If so which option should i use to truncate the table in the oracle enterprise stage.

thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As long as the table is actually 'truncatable' - privs, RI, etc - then it should just take putting the truncate command in the OPEN option of the OE stage to accomplish that, I do believe.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

You can do this in the 'before job routine' as well.

Regards
Sreeni
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Which would typically mean a scripted call to sqlplus.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Or an Open command in the Oracle Enterprise stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

... which has already been mentioned. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
HariK
Participant
Posts: 68
Joined: Thu May 17, 2007 1:50 am

Post by HariK »

If you want to truncate then why do it in first job.
you can do the same as well in second job either by using any of the solutions mentioned above or simply using the Load method with truncate option.
Post Reply