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: Renaming a sequence

Re: Renaming a sequence

From: Brian Tkatch <SPAMBLOCK.Maxwell_Smart_at_ThePentagon.com.SPAMBLOCK>
Date: Thu, 22 Nov 2001 22:53:55 GMT
Message-ID: <3bfd817e.289543453@news.alt.net>


On Thu, 22 Nov 2001 16:27:14 +0100, "Tom Williams" <tom_at_auga.com> wrote:

>Not quite Conner...it only appears to work because if you try the following:
>
>SQL> create sequence x;
>
>Sequence created.
>
>SQL> select x.nextval from dual;
>
> NEXTVAL
>---------
> 1
>
>SQL> select x.nextval from dual;
>
> NEXTVAL
>---------
> 2
>
>SQL> rename x to y;
>
>Table renamed.
>
>SQL> select y.nextval from dual;
>
> NEXTVAL
>---------
> 21
>
>Not exactly the result one is looking for...but rather another of Oracle's
>great mysteries.
>

Mystery? Not at all. Apparently when you rename a sequence you lose everything in the cache.

Add the NOCACHE keyword, and it works as "expected".

Brian Received on Thu Nov 22 2001 - 16:53:55 CST

Original text of this message

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