home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.oracle
- Path: sparky!uunet!centerline!news
- From: Devan F. Dewey <dewey@centerline.com>
- Subject: Re: Referencing a SEQUENCE from a trigger...
- Message-ID: <1992Jul21.121227.1455@centerline.com>
- Sender: news@centerline.com
- Nntp-Posting-Host: sebastian
- Organization: CenterLine Software
- X-Useragent: Nuntius v1.1a2
- References: <1992Jul20.195514.8085@unixg.ubc.ca>
- Date: Tue, 21 Jul 1992 12:12:27 GMT
- Lines: 23
-
-
-
- >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
-