Page 1 of 1

Upsert mode in Oracle

Posted: Wed Aug 15, 2012 2:10 pm
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?

Posted: Wed Aug 15, 2012 3:01 pm
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.

Posted: Wed Aug 15, 2012 3:06 pm
by chulett