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

Home -> Community -> Usenet -> c.d.o.misc -> Re: reset a sequence in a trigger

Re: reset a sequence in a trigger

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Thu, 19 May 2005 19:36:42 -0700
Message-ID: <zPKdnc3rR9-e0BDfRVn-qQ@comcast.com>

"Werner Hofmann" <superomega_at_t-online.de> wrote in message news:d6j7so$u3r$02$1_at_news.t-online.com...
> >
> > Stupid question maybe but why reset it? A sequence is a large number.
> > Are you try to save numbers? You can set a max value and then cycle
> > it. Resetting a sequence just seems like you're going about solving
> > the wrong problem.
> >
> > Thanks,
> >
> > Lewis
> >
>
> In this table I have a lot of transactions, and it can be, that the ID
which
> is the primary key can overrun after some time (some years). I can not use
> another primary key, because this would be with a VARCHAR2 column. And so
I
> wantet to be save, that the oldest entry have the smallest ID for sorting.
>
> Werner

Look at global temporary tables. This will probably do what you want very nicely and not reset the sequence. I could see some major concurrency issues with resetting the sequence dynamically like that. Jim Received on Thu May 19 2005 - 21:36:42 CDT

Original text of this message

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