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 13:12:49 -0800
Message-ID: <F001.00540FF6.20030131131249@fatcity.com>


Did you use 'recycle'?
Sequence must not use 'cache' when attempting to do this.

You may also want to check out other options from the Google link posted by Raj.

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

Kirti,

I have to set the maxvalue manually, when I do this still nextval not reset. For example if the maxvalue is 1000000 and the current value is 500, some how I have to set alter sequence to reach the maxvalue so the next value start from 0 again.
This test doesn't do that.

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

Please post your test...

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

Kirti,

I test it it doesn't work.

-----Original Message-----
Sent: Friday, January 31, 2003 11:09 AM
To: ORACLE-L_at_fatcity.com
Cc: Hamid Alavi

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: 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).

--

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 - 15:12:49 CST

Original text of this message

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