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

Home -> Community -> Usenet -> c.d.o.server -> Re: Automatically reset Sequence to initial value?

Re: Automatically reset Sequence to initial value?

From: Christoph Glanz <christoph.glanz_at_hamburg.snafu.de>
Date: 1997/10/19
Message-ID: <01bcdba1$a75d2bd0$0100007f@hal>#1/1

Hi, Claus,

Claus Jensen <cje_at_stibo.com> wrote
> Todd Owers wrote:
>

>>[...]  

> You should be able to do it with dbms_job "the Oracle variant of cron".
> BTW, you can't reset it to it's initial value by "alter sequence ...".
> You must drop it and recreate it again, unless this has changed from
> 7.1.x (which I'm currently stuck on).

If you like, you can do it without dropping the sequence:

- select <sequence>.nextval from dual;
- use the gotten value to do:
- alter sequence <sequence> increment by -<value>;
- select <sequence>.nextval from dual to reset it
- alter sequence <sequence> increment by <increment-value> to set the 

   original increment.
That's it.

>
> Best wishes
> Claus Jensen
>

Greetings
Christoph Glanz

-- 

--------------------------------------------------------------------
Christoph Glanz
Hamburg
Germany
EMail: Christoph.Glanz_at_hamburg.snafu.de
Received on Sun Oct 19 1997 - 00:00:00 CDT

Original text of this message

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