Page 1 of 1

What is the best way to truncate source table.

Posted: Tue Dec 12, 2006 10:12 pm
by xinhuang66
what is the best way to truncate source table after job succeed, source table was in different server from target tables.

thanks

Posted: Tue Dec 12, 2006 10:19 pm
by kumar_s
Either include another stage after the target stage, or make use of Afterjob Subroutine with the command line options for the database.
But you can mention the edition of the Datastage, to get more appropriate answers.

Posted: Tue Dec 12, 2006 10:31 pm
by DSguru2B
Have a second job that does the truncate. Or you can have a small stored procedure and call that stored procedure in the second job. Keep them seperate.

Posted: Wed Dec 13, 2006 12:35 am
by I_Server_Whale
DSguru2B wrote: Keep them seperate.
I'm wondering the reason behind that suggestion.

Any specific reason? Why not do it in a single/same job?

Whale.

Posted: Wed Dec 13, 2006 1:05 am
by ray.wurlod
One possible reason is looking ahead to the day when/if it's converted to a parallel job, in which it is not possible to do it in the same job.

Another reason is philosophical - the original requirement specified "after" - having separate jobs makes it easy to make this "after" relationship obvious in a job sequence.

Posted: Wed Dec 13, 2006 7:02 am
by DSguru2B
Modularization, Restartability.