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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: why this code does not work in sqlplus?

Re: why this code does not work in sqlplus?

From: Rajagopal Venkataramany <rajagopalvr_at_hotmail.com>
Date: Mon, 22 May 2000 16:47:18 GMT
Message-Id: <10505.106253@fatcity.com>


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
                  *

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
also send the HELP command for other information (like subscribing).


________________________________________________________________________
Received on Mon May 22 2000 - 11:47:18 CDT

Original text of this message

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