Home » SQL & PL/SQL » SQL & PL/SQL » Sequence Problem
Sequence Problem [message #23499] Fri, 13 December 2002 00:12 Go to next message
Venmathi
Messages: 1
Registered: December 2002
Junior Member
Hai,

I have a sequence whose currval is now 100, I want

to reset to 1. But I don't want to change the

increment parameters or anything, just I want to reset

the start value only.

With regards,
Venmathi
Re: Sequence Problem [message #23504 is a reply to message #23499] Fri, 13 December 2002 06:46 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
this sequence is initially created with an increment by 1.
reset the sequence with a negative increment.
and again reset the sequence with the original increment.
SQL> ed
Wrote file afiedt.buf

  1* select seq123.nextval from dual
SQL> /

   NEXTVAL
----------
        21

SQL>  alter sequence seq123 increment by -20
  2  ;

Sequence altered.

SQL> select seq123.nextval from dual;

   NEXTVAL
----------
         1

SQL> alter sequence seq123 increment by 1
  2  ;

Sequence altered.

SQL> /

Sequence altered.

SQL> select seq123.nextval from dual;

   NEXTVAL
----------
         2

SQL> /

   NEXTVAL
----------
         3

SQL> 

Previous Topic: printing output to a printer from pl/sql procedure
Next Topic: How to know the String has numbers.........
Goto Forum:
  


Current Time: Thu May 16 17:03:40 CDT 2024