delete and insert in the same oracle enterprise stage

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
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

delete and insert in the same oracle enterprise stage

Post by dodda »

Hello

I have a requirement where my source is flat file and target is Oracle enterprise stage. I have to insert the data into oracle enterprsie stage before i do that i want to delete certain recrods and then do the inserts.
Is it possible to do the Delete first and then Insert in the same oracle enterprise stage.

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Perhaps... it really depends on exactly what "delete certain records" means. Do you need to delete once or before every row? For the latter, does what needs to be deleted bear any resemblance to what is being added, key-wise?
-craig

"You can never have too many knives" -- Logan Nine Fingers
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

Post by dodda »

hello chulett,

thankyou for your reply. In our case lets say we have table called PURCHASE and has field1, and field2. We need delete the records where field1='A' before we do inserts into the same table. we dont have any keys defined on the PURCHASE table.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

A 'one time' delete like that would be something you could do as the 'Open Command' since that runs once when the job starts.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply