Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Automatically reset Sequence to initial value?
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.deReceived on Sun Oct 19 1997 - 00:00:00 CDT