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: Using Sequence Gen in Trigger

Re: Using Sequence Gen in Trigger

From: The Wils <awislon_at_rci.rogers.com>
Date: 1997/04/30
Message-ID: <3367A005.1C4A@rci.rogers.com>#1/1

Rick Ryan wrote:
>
> Can a Sequence be used in a insert before row Trigger?
>
> create or replace trigger package_id_trigger
> before insert on tracking
> for each row
>
> begin
>
> :new.R_45_145_Package_ID := package_seq.nextval;
>
> end;
>
> When I compile this trigger I get a error stating that a Sequence can't be
> used in this context. It seems you can only use " package_seq.nextval" in an
> insert statement?
>
> Any input.........
>
> Thanks Rick Ryan....
> rickryan_at_global2000.net

Only that Error Message ORA-2201 says that Sequences can only be used in a Select-List.

       select package_seq.nextval
         into :new.R_45_145_Package_ID;

should do the same job.

Alan Wilson



The man who follows the crowd will usually get no further than the crowd. The man who walks alone is likely to find himself in places no one has ever been.
Received on Wed Apr 30 1997 - 00:00:00 CDT

Original text of this message

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