Re: update multiple rows continue past exceptions
From: yossarian <yossarian99_at_operamail.com>
Date: Tue, 15 Dec 2009 11:03:47 +0100
Message-ID: <4b275f03$0$6821$5fc30a8_at_news.tiscali.it>
Shakespeare wrote:
Date: Tue, 15 Dec 2009 11:03:47 +0100
Message-ID: <4b275f03$0$6821$5fc30a8_at_news.tiscali.it>
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. Received on Tue Dec 15 2009 - 04:03:47 CST