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: [EMAIL PROTECTED]
> 
> 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: [EMAIL PROTECTED] (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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to