Re: update multiple rows continue past exceptions

From: jimmyb <jimmybrock_at_gmail.com>
Date: Fri, 11 Dec 2009 15:43:43 -0800 (PST)
Message-ID: <d3cfe3bc-9d53-4cac-8944-946360c7d7f9_at_a39g2000pre.googlegroups.com>



On Dec 11, 2:41 pm, lora <anjela_..._at_yahoo.com> wrote:
> Hello all,
>
> I need to update as many rows as possible. The issue is that one row
> that fails causes the entire transaction to fail.
>
> How do I get around this? I'd like to complete all UPDATE rows that
> don't have the exception. The below doesn't seem to work.
>
> I'm using Oracle 10g
>
> Thanks a bunch!
>
> BEGIN
> UPDATE MYTAB SET request = REPLACE(request, '$tpsToModify',
> 'tpsToModify') WHERE request like '%$tpsToModify%';
>  EXCEPTION
>     when dup_val_on_index then
>         dbms_output.put_line('DUPLICATE RECORD');
>
> END;
http://www.oracle.com/technology/oramag/oracle/09-mar/o29plsql.html

Scroll half-way down to "DML Error Logging" Received on Fri Dec 11 2009 - 17:43:43 CST

Original text of this message