| 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,
Here is how you should use it.
column max_val new_value max_value
select max(PROMOTIONID)+1 max_val
from hpxpromotion;
drop sequence HPXSEQ_Promotion;
CREATE SEQUENCE HPXSEQ_Promotion
INCREMENT BY 1
START WITH &&max_value
MAXVALUE 999999999
MINVALUE 1
NOCYCLE
NOCACHE;
Regards
Rajagopal Venkataramany
----Original Message Follows----
From: "Guang Mei" <zlmei_at_hotmail.com>
Reply-To: ORACLE-L_at_fatcity.com
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
Subject: why this code does not work in sqlplus?
Date: Mon, 22 May 2000 07:58:35 -0800
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
*
Here is the script:
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
-- 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 also send the HELP command for other information (like subscribing).Received on Mon May 22 2000 - 11:47:18 CDT
________________________________________________________________________
![]() |
![]() |