Page 1 of 1

Delete and Insert

Posted: Wed Jun 26, 2013 11:46 am
by bond88
Hi,
Please suggest me a best way.

First run:
Source: 30 million rows
Target : 30 million rows

After first run from second time on wards I have to delete 2013 records on target and insert 2013 records.

I designed job like

Oracle connector -----> Oracle connector

Source side:
select *
from *****
where year =2013

On target side
Write mode: Bulk load
Table Action: Append
Run Before and after sql statements: YES
Before SQL Statement : Delete from ***** where year=2013

Thanks,

Posted: Wed Jun 26, 2013 1:30 pm
by chulett
I'm thinking that's about as best as it gets if those are literally your requirements - every day a full refresh of all records for that year. I assume there are records for other years in the table?

Posted: Wed Jun 26, 2013 1:33 pm
by bond88
Yes Chulett,
It contains records with all years. On Target side can I use bulk load and before sql statement or Delete and then insert ? Whats the difference between these two?

Thank you,

Posted: Wed Jun 26, 2013 1:39 pm
by chulett
You wouldn't be able to bulk load if you went the delete and insert route as that turns every insert into two operations - first a transactional delete and then the insert. Better to 'bulk' delete and then bulk load.

Posted: Wed Jun 26, 2013 2:24 pm
by bond88
Thanks Chulett.