Oracle Inserts

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

dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

Post by dodda »

Thanks for your help

Just wondering whether UPSERT mode works for only inserts?

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

Post by chulett »

Sure, but the question is in what order are the operations performed? Either way will work as desired - provided the updates are filtered out - but best to perform the insert attempt first so that you don't burn two database operations for every record. I don't have any kind of access right now, do you have control over if it does "insert else update" versus "update else insert"?
-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 »

Thanks

Well these are the options

If we mention Write method as UPSERT then i can see options under Upsert Order (Insert then Update) and (Update then Insert). According to what I understood is as i am filtering out Updates in can use Insert then update as Upsert order. Am i Right?

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

Post by chulett »

As noted, either will work but "Insert then Update" would be the smarter choice. :wink:
-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 »

Thanks

But under Upsert mode i can see 4 options

Autogenerated Update & Insert
Autogenerated Update only
user defined Update& Insert
user defined Update only

can i go for First option?

Thanks
betterthanever
Participant
Posts: 152
Joined: Tue Jan 13, 2009 8:59 am

Post by betterthanever »

yes you can go for that...unless you want to mention INSERT/UPDATE statements manually.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Since for whatever reason you don't seem to have "Insert then Update" as an option, then yes - go manual and include only the insert dml.
-craig

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