Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL: how to let it continue when unique constraint violated
Write a small sql-procedure which reads one record and inserts this one records
into the other table just like this.
declare
cursor f1 is select a from b;
c b.a%TYPE;
begin
open f1;
fetch f1 into c;
while f1%FOUND
loop
insert into b values (c); fetch f1 into c;
Jeff wrote:
> Hi,
>
> How to let the PL/SQL continue to run when I select some rows and insert
> them to another table, without quited immediately when unique constraint is
> violated, such that the other records can still be inserted?
>
> Jeff
--