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: ReInitiate Sequence Number

RE: ReInitiate Sequence Number

From: Deshpande, Kirti <kirti.deshpande_at_verizon.com>
Date: Fri, 31 Jan 2003 11:12:42 -0800
Message-ID: <F001.00540CE0.20030131111242@fatcity.com>


Hamid,

Here is one way:

SQL> select myseq.currval from dual;

   CURRVAL


         4

SQL> alter sequence myseq nocache;

Sequence altered.

SQL> alter sequence myseq maxvalue 4 cycle;

Sequence altered.

SQL> select myseq.nextval from dual;

   NEXTVAL


         1

SQL> REM ---> Other alter sequence commands to change maxvalue, cache, nocycle etc.                

Now, you get to do the tricky part of automating it ;) Because, I have not attempted to do it, yet.

HTH,

-----Original Message-----
Sent: Friday, January 31, 2003 12:21 PM
To: Multiple recipients of list ORACLE-L

Dear List,

How can I reinitiate a sequence Instead or dropping & recreating it, I want every night my sequence number reinitiate and start from 1 again. Thanks for your help.

Hamid Alavi

Office : 818-737-0526
Cell phone : 818-416-5095

--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author: Hamid Alavi
  INET: hamid.alavi_at_quovadx.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
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).

--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author: Deshpande, Kirti
  INET: kirti.deshpande_at_verizon.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
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 Fri Jan 31 2003 - 13:12:42 CST

Original text of this message

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