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: Triggers and Sequences

Re: Triggers and Sequences

From: Christopher Beck <clbeck_at_us.oracle.com>
Date: Thu, 05 Nov 1998 14:03:32 GMT
Message-ID: <3642afa6.90266195@dcsun4.us.oracle.com>


On 3 Nov 1998 08:36:52 GMT, HWaldherr.MCenter_at_t-online.de (Heinz Waldherr) wrote:

>Hi all,
>
>that's a simple one, I'm sure.
>
>How do I set a value for a column in a trigger using a sequence?
>
>I only get "invalid trigger" messages, when I try doing it. Guess it's a
>matter of syntax.
>

You have to select the sequence value into the column.

create or replace
trigger myTrigger
before insert on table1
for each row
begin
  select myseq.nextval
    into :new.c1
    from dual;
end;
/

>Any (quick) help highly appreciated.
>
>Heinz
Received on Thu Nov 05 1998 - 08:03:32 CST

Original text of this message

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