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

Home -> Community -> Usenet -> c.d.o.tools -> Re: How to reset Sequence values ?

Re: How to reset Sequence values ?

From: <mhr123_at_my-deja.com>
Date: Thu, 25 Jan 2001 14:06:54 GMT
Message-ID: <94pbtp$cbu$1@nnrp1.deja.com>

In article <94ouvh$jrr$1_at_marte.lastminutetour.com>,   "hunter" <fmarchioni_at_libero.it> wrote:
> Hello!
> I have built some tables where primary keys are incremented via
> Sequence values.I put some dummy values to test the software
> but now I have to clean tables for real use of the software.
> The matter is that sequence values still keep count of their
> values even if I deleted all records.....how can I remedy it?
> is it possible to reset sequence count?
> Thanks
> Francesco
>
>

Hi,

Another strategy is to "backdate" the sequence!

Look at this example:SQL>select test_seq.nextval from dual;

   NEXTVAL


         6

SQL>alter sequence test_seq increment by -5;

Sekvens er ændret.

SQL>select test_seq.nextval from dual;

   NEXTVAL


         1

SQL>alter sequence test_seq increment by 1;

Sekvens er ændret.

SQL>select test_seq.nextval from dual;

   NEXTVAL


         2

Regards, Michael

Sent via Deja.com
http://www.deja.com/ Received on Thu Jan 25 2001 - 08:06:54 CST

Original text of this message

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