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: Andreas Michler <Andreas.Michler_at_adicom.de>
Date: Fri, 21 Jan 2000 08:13:45 +0100
Message-ID: <38880728.67FFEB40@adicom.de>


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;

    end loop;
    commit;

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

--



ADICOM Informatik GmbH
Andreas Michler
Wiesfleckenstr. 34
72336 Balingen
Tel: 07433/9977-57,Fax: -90
E-Mail: Andreas.Michler_at_adicom.de
http:\\www.adicom.de
Received on Fri Jan 21 2000 - 01:13:45 CST

Original text of this message

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