Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: HELP: Attempting to use Before Triggers and Sequences to auto-generate Primary Keys
I used your code on a V7.3.3 database. It works if I replace
:new.Id := Test_SEQ.NEXTVAL;
with
select Test_SEQ.NEXTVAL into :new.Id from dual;
Doug
Lee Doty <iarld_at_connectnet.com> wrote in article <33a1c8d4.17499412_at_news.connectnet.com>...
> anyone have any idea if this is possible? The functionality I want is:
> CREATE OR REPLACE TRIGGER Test_TRG
> BEFORE INSERT
> ON Activator
> FOR EACH ROW
> WHEN ( new.Id IS NULL )
> BEGIN
>
> :new.Id := Test_SEQ.NEXTVAL;
>
> END;
Received on Fri Jun 13 1997 - 00:00:00 CDT