Upsert mode in Oracle

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
sharmabhavesh
Premium Member
Premium Member
Posts: 38
Joined: Tue Jun 19, 2012 11:03 pm
Location: India

Upsert mode in Oracle

Post by sharmabhavesh »

Hi,
I am trying to replicate an old code into my system. At one of the places an Oracle table is uisng Upsert mode. I tried googling out the meaning of Upsert mode but no where could I find a good explanation. Could anyone explain me with an example what an Upsert mode actually does?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Upsert does one of two things.
1. It attempts to UPDATE and, if that fails because the record does not exist, it performs an INSERT.
2. It attempts to INSERT and, if that fails because the record already exists, it performs an UPDATE.
Which of these occurs depends on the setting of an additional property.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

-craig

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