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

Home -> Community -> Usenet -> c.d.o.misc -> how to catch the sequence value generated in a trigger

how to catch the sequence value generated in a trigger

From: Vincent Lemaire <v.Lemaire_at_kheops.com>
Date: Fri, 28 May 1999 16:10:52 +0200
Message-ID: <7im831$cp9$1@minus.oleane.net>


I wrote this script :

create or replace trigger tr before insert on t for each row
declare

     nv number;
begin

     select s.nextval into nv from dual;
     :new.c := nv;
     raise_application_error (-20101,nv);
end;

the raise_application_error call is followed by an automatic rollback and the new record is not inserted, althought I want it to be inserted and the sequence value returned to my application do you have any idea to avoid the rollback ? or any other method to return the sequence value ? Received on Fri May 28 1999 - 09:10:52 CDT

Original text of this message

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