Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: creating sequence using a variable

Re: creating sequence using a variable

From: Phil Haigh <phil.haigh_at_fwpharma.com>
Date: Tue, 22 May 2001 22:43:53 +0100
Message-ID: <v4BO6.1717$8Z5.77677@monolith.news.easynet.net>

ziv wrote in message <5b98834.0105221318.5388547f_at_posting.google.com>...
>Hi all,
>I am trying to create a sequence using a variable which I will read in to a
 value.
>I get an erroe -01722 invalid number.
>any one?
>Thanks

Not quite sure what your issue is but here goes...

Presumably you've already created your sequence:

    create sequence my_seq;
You can then grab values using my_seq.nextval (which increments the counter) and my_Seq.currval (which returns the value you last obtained from nextval):

    SELECT my_seq.nextval FROM Dual (SQL*Plus)     SELECT my_seq.nextval INTO myVar FROm Dual (PL/SQL) Received on Tue May 22 2001 - 16:43:53 CDT

Original text of this message

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