Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: why this code does not work in sqlplus?
Hi!
If you look at the syntax, only an integer is permitted with START WITH. The variable is not permitted.
***
START WITH specifies the first sequence number to be generated. You can use
this option to start an ascending sequence at a value greater than its
minimum or to start a descending sequence at a value less than its maximum.
For ascending sequences, the default value is the sequence's minimum value.
For descending sequences, the default value is the sequence's maximum value.
This integer value can have 28 or less digits.
Claire
Copyright (c) 1994, Oracle Corporation.
----- Message d'origine -----
De : Guang Mei <zlmei_at_hotmail.com>
À : Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
Envoyé : lundi 22 mai 2000 11:58
Objet : why this code does not work in sqlplus?
> Hi:
>
> I am trying to create some oracle sequence based on the current max ID
> value. Does any one know why it does not work in sqlplus? I got the
> following error:
>
>
> MAX(PROMOTIONID)
> ----------------
> 69819
> START WITH :maxpromotionid +1
> *
> ERROR at line 3:
> ORA-01722: invalid number
>
>
>
> Here is the script:
> -------------------
> variable maxpromotionid NUMBER;
>
> select max(promotionID)
> into :maxpromotionid
> from hpxpromotion;
>
>
> CREATE SEQUENCE HPXSEQ_Promotion
> INCREMENT BY 1
> START WITH :maxpromotionid +1
> MAXVALUE 999999999
> MINVALUE 1
> NOCYCLE
> NOCACHE;
> ----------------------
>
> If you reply, please send me a copy to zlmei_at_hotmail.com
>
> Thanks.
>
> Guang
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
> --
> Author: Guang Mei
> INET: zlmei_at_hotmail.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
Received on Mon May 22 2000 - 11:17:06 CDT
![]() |
![]() |