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: Daniel Wisser <daniel.wisser_at_isis-papyrus.com>
Date: Mon, 03 Feb 2003 01:28:58 -0800
Message-ID: <F001.00541D29.20030203012858@fatcity.com>


hi hamid!

what about doing it with by twice altering the sequence:

/* create the seq */
SQL> create sequence myseq nomaxvalue nocycle nocache order; /* reset the seq */
SQL> select myseq.currval from dual;
/* assume that curval = 6 */
SQL> alter sequence myseq maxvalue 6 cycle; /* back at 1 */
SQL> select myseq.nextval from dual;

   NEXTVAL


         1

/* back to normal incrementation */
SQL> alter sequence myseq nomaxvalue nocycle nocache order;

khoda hafez!
daniel

Hamid Alavi wrote:
>
> 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
>
> ======================= Confidentiality Statement =======================
> The information contained in this message and any attachments is
> intended only for the use of the individual or entity to which it is
> addressed, and may contain information that is PRIVILEGED, CONFIDENTIAL
> and exempt from disclosure under applicable law. If you have received
> this message in error, you are prohibited from copying, distributing, or
> using the information. Please contact the sender immediately by return
> e-mail and delete the original message from your system.
> ===================== End Confidentiality Statement =====================
>
> --
> 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: Daniel Wisser
  INET: daniel.wisser_at_isis-papyrus.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 Mon Feb 03 2003 - 03:28:58 CST

Original text of this message

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