Page 1 of 1

Truncate and reload the table using ODBC

Posted: Wed Dec 06, 2006 9:15 am
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.

Posted: Wed Dec 06, 2006 5:19 pm
by samsuf2002
u tryu using after job sub routine where u can truncate the table after the job is processed

Posted: Wed Dec 06, 2006 8:01 pm
by ray.wurlod
You can't truncate the table on which you have an open SELECT cursor!

Posted: Wed Dec 06, 2006 8:23 pm
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.

Posted: Thu Dec 07, 2006 4:33 am
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.

Posted: Thu Dec 07, 2006 8:57 am
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