Page 1 of 1

Truncate table

Posted: Tue Oct 27, 2009 7:31 pm
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

Posted: Tue Oct 27, 2009 9:08 pm
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.

Posted: Wed Oct 28, 2009 9:31 am
by Sreenivasulu
You can do this in the 'before job routine' as well.

Regards
Sreeni

Posted: Wed Oct 28, 2009 10:01 am
by chulett
Which would typically mean a scripted call to sqlplus.

Posted: Wed Oct 28, 2009 11:23 am
by ray.wurlod
Or an Open command in the Oracle Enterprise stage.

Posted: Wed Oct 28, 2009 1:24 pm
by chulett
... which has already been mentioned. :wink:

Posted: Thu Oct 29, 2009 6:12 am
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.