Re: Referencing a SEQUENCE from a trigger...

From: Devan F. Dewey <dewey_at_centerline.com>
Date: Tue, 21 Jul 1992 12:12:27 GMT
Message-ID: <1992Jul21.121227.1455_at_centerline.com>


>I've got a situation where I need to insert rows into a table in a
>ON-VALIDATE-FIELD trigger. For these rows, I need a serial no which I'm
>getting from a SEQUENCE. However, I can't seem to reference the SEQUENCE.
>I'm doing something like:
>
> new_ref := :SEQUENCE.V_REF_NO_SEQ.NEXTVAL;
>
>which gets me the error messages:
>
> PL/SQL error 49 at line 10, column 16:
> bad bind variable 'sequence.v_ref_no_seq'

Form V3 I hope.

To reference a sequence, you must use select into:

select SEQUENCE.V_REF_NO_SEQ.NEXTVAL into new_ref from dual;

Hope this helps.

-Devan Received on Tue Jul 21 1992 - 14:12:27 CEST

Original text of this message