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: ziv <zbaumel_at_shadowfinancial.com>
Date: 23 May 2001 07:04:49 -0700
Message-ID: <5b98834.0105230604.3a671631@posting.google.com>

Let me explain what is the problem.

I would like to create a sequence starting with a value I get from a select statment.

CREATE SEQUENCE <NAME> START WITH <VARIABLE> .....

ORACLE gives me invalid number error.
The variable is define correctly, I can print the value to the screen with no problem, but the CREATE SEQUENCE does not like it.

Thanks
Ziv

"Phil Haigh" <phil.haigh_at_fwpharma.com> wrote in message news:<v4BO6.1717$8Z5.77677_at_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 Wed May 23 2001 - 09:04:49 CDT

Original text of this message

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