Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> how to catch the sequence value generated in a trigger
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
![]() |
![]() |