Delete and Load the Table

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
maurya
Participant
Posts: 1
Joined: Tue Feb 20, 2007 12:59 pm

Delete and Load the Table

Post by maurya »

I am trying to Develop a DS process.....
1. First I need to delete the Data in the Table for a Quarter of a Year.
2. Insert records in the same Table for the same Quarter.
Since it is going to be an ongoing thing, I need to develop a DS job. Well I would like both my criteria to be satisfied in the same Job. I would like to know if I will be able to do so.
I know I can create a Delete process first and then the Insert process and call both the jobs. I would like to avoid this.
MT
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 09, 2007 3:51 am

Re: Delete and Load the Table

Post by MT »

Hi maurya,

it is simple to create a single job for that where you delete data before you insert the new ones (i.e. before SQL) but I think performance is a important thing for that.
I do not know which database you use but I recommend to closely work together with the DBA in order to support your job design for the database side.
Bulk deletes can cause a lot of trouble.

regards
Michael
regards

Michael
abhilashnair
Participant
Posts: 284
Joined: Fri Oct 13, 2006 4:31 am

Post by abhilashnair »

You cannot delete from a table and insert it at the same time. It will cause a deadlock
betterthanever
Participant
Posts: 152
Joined: Tue Jan 13, 2009 8:59 am

Re: Delete and Load the Table

Post by betterthanever »

[quote="maurya"]I am trying to Develop a DS process.....
1. First I need to delete the Data in the Table for a Quarter of a Year.
2. Insert records in the same Table for the same Quarter.
Since it is going to be an ongoing thing, I need to develop a DS job. Well I would like both my criteria to be satisfied in the same Job. I would like to know if I will be able to do so.
I know I can create a Delete process first and then the Insert process and call both the jobs. I would like to avoid this.[/quote]

use open command,
BEGIN
Delete from Table_name where qauarter ='#Quatrter#';
Commit;
END;

keep the write mode in 'Append' and you should be good.
Post Reply