Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Need assist w/ BEFORE INSERT trigger
Ed Stevens <nospam_at_noway.nohow> wrote in message news:<oq0aa0hgbrsdhido89vo6p0i85igk31mu7_at_4ax.com>...
>
> Here's what I have:
>
> CREATE OR REPLACE TRIGGER TRG_MSGRTR_FORCE_PK
> BEFORE INSERT
> ON MESSAGE_ROUTER
> REFERENCING OLD AS OLD NEW AS NEW
> FOR EACH ROW
> begin
> :NEW.MSGRTE_MSG_SEQNBR := SQ_MSG_SLNO.NEXTVAL;
> END;
> /
>
> which yeilds this error
>
> PLS-00357: Table, view or sequence reference 'SQ_MSG_SLNO.NEXTVAL' not
> allowed in this context.
>
Good idea, you just need to wrap the sequence in a select e.g.
select sq_msg_slno.nextval
into :new.msgrte_msg_seqnbr
from dual;
On a side note why is the redundant line referencing old as old ... etc so common, is it from the docs? Received on Sat May 15 2004 - 00:17:07 CDT