Delete and Insert

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
bond88
Participant
Posts: 109
Joined: Mon Oct 15, 2012 10:05 am
Location: USA

Delete and Insert

Post 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,
Bhanu
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
bond88
Participant
Posts: 109
Joined: Mon Oct 15, 2012 10:05 am
Location: USA

Post 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,
Bhanu
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
bond88
Participant
Posts: 109
Joined: Mon Oct 15, 2012 10:05 am
Location: USA

Post by bond88 »

Thanks Chulett.
Bhanu
Post Reply