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: question about plsql exceptions

Re: question about plsql exceptions

From: <stefanomnn_at_yahoo.it>
Date: 25 Feb 2006 02:51:53 -0800
Message-ID: <1140864713.214005.42580@p10g2000cwp.googlegroups.com>


Hi! thank u for your answere!
my aim is making N insert, in a cyvle (while or for)... but i have to ignore primary key violated errors (then, if an item is present, no problem)
i didn't find a predefined exception, then i made so:

while (---) loop

    begin
    insert statement
    exception

      when others then
           if(sqlcode  <> -1) then  -- -1: oracle code when primary key
violated
               raise;
          ed if

    end;
end loop

is it a good solution?
i thought to make a select count, but i found my method more efficient, because pk violated errors are not frequent... Received on Sat Feb 25 2006 - 04:51:53 CST

Original text of this message

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