From: yossarian on
Shakespeare wrote:

>>> This is a regular event in our shop. Our developers used to try to
>>> insert, and then handle the exception if it existed and update it. We
>>> cut our redo by a large factor when we asked them to switch to MERGE.
>>
>> They used to do an UPDATE when an exception was raised? That should be
>> a bad coding practice in every shop, JMO.
>
> Not if the exception is a dup-val-on-index. Its a practice seen all around!

IMHO the more efficient way is to try to update the row first, then
perform an insert if sql%rowcount=0.

Y.