Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL: how to let it continue when unique constraint violated

Re: PL/SQL: how to let it continue when unique constraint violated

From: david_g <david_l_gouldNOdaSPAM_at_yahoo.com.invalid>
Date: Fri, 21 Jan 2000 01:44:08 -0800
Message-ID: <08f6992b.b84e0bdb@usw-ex0106-048.remarq.com>


In order to ignore the duplicate key value error and continue, you need the dup_value_in_index as a local exception:

declare cursor c1 is select myvalue from mytable;

begin

   for l1 in c1 loop

       begin

          insert into mynewtable values (l1.myvalue);

       exception

          when dup_value_in_index then

              null;
       end;

   end loop;

end;

Received on Fri Jan 21 2000 - 03:44:08 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US