Page 1 of 1

Delete and Load the Table

Posted: Fri Mar 11, 2011 8:37 am
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.

Re: Delete and Load the Table

Posted: Fri Mar 11, 2011 8:48 am
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

Posted: Fri Mar 11, 2011 8:49 am
by abhilashnair
You cannot delete from a table and insert it at the same time. It will cause a deadlock

Re: Delete and Load the Table

Posted: Fri Mar 11, 2011 9:56 am
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.