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 -> Re: HELP: Attempting to use Before Triggers and Sequences to auto-generate Primary Keys

Re: HELP: Attempting to use Before Triggers and Sequences to auto-generate Primary Keys

From: Douglas Dunnigan <douglas_at_yogananda-srf.org>
Date: 1997/06/13
Message-ID: <01bc7855$b04fbbe0$63080c26@systems-douglas>#1/1

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

Original text of this message

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