What is the best way to truncate source table.

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
xinhuang66
Participant
Posts: 161
Joined: Wed Aug 02, 2006 4:30 am

What is the best way to truncate source table.

Post by xinhuang66 »

what is the best way to truncate source table after job succeed, source table was in different server from target tables.

thanks
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post 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.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Modularization, Restartability.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply