Truncate and reload the table using ODBC

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
Titto
Participant
Posts: 148
Joined: Tue Jun 21, 2005 7:49 am

Truncate and reload the table using ODBC

Post by Titto »

Hi,

I am trying to select from a Table-A using ODBC section in the process and funnel the records with new records and Truncate and Write the new records to the Table-A.

But when i am tying to select from Table-A, it is not fetching any records as the Table-A has no records - but there are records in that Table-A.
I think in the process before selection it is Truncating the Table-A.

Is there any way not to truncate the Table-A until the end of the process or not before Selecting the data from the Table-A.

Any help is appreciated.
samsuf2002
Premium Member
Premium Member
Posts: 397
Joined: Wed Apr 12, 2006 2:28 pm
Location: Tennesse

Post by samsuf2002 »

u tryu using after job sub routine where u can truncate the table after the job is processed
hi sam here
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can't truncate the table on which you have an open SELECT cursor!
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 »

samsuf2002 wrote:u tryu using after job sub routine where u can truncate the table after the job is processed
What? :?

Titto - you need a two step process. First select and land the records from the table. Then a separate job to truncate and reload. Two steps.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Nageshsunkoji
Participant
Posts: 222
Joined: Tue Aug 30, 2005 2:07 am
Location: pune
Contact:

Post by Nageshsunkoji »

chulett wrote: First select and land the records from the table. Then a separate job to truncate and reload. Two steps.
Yes, Its a Good Idea, first select the records and land in a dataset in JobA and then IN JobB trunacate those records. It will avoid you all of your problems regarding Truncation.
NageshSunkoji

If you know anything SHARE it.............
If you Don't know anything LEARN it...............
Titto
Participant
Posts: 148
Joined: Tue Jun 21, 2005 7:49 am

Post by Titto »

chulett wrote: First select and land the records from the table. Then a separate job to truncate and reload. Two steps.
I did split the job into 2 jobs - one create a load file and the next job to truncate and insert the new load file.

Thanks for the Information.

~Titto
Post Reply