Re: How do we set new value for a SEQUENCE?

From: <pberetta_at_my-deja.com>
Date: Tue, 22 Feb 2000 10:47:09 GMT
Message-ID: <88tpfc$ms2$1_at_nnrp1.deja.com>


Ingvar,

   Or if you want your sequencer to advance by 20 every time, you can create it with an INCREMENT BY 20 clause. If you need to increment it randomly, you may be better off with a small table to hold a single value (or a single column of values) and a function to retrieve the current (or MAX()) value, increment that value, update (or insert into) the small table, then return the incremented value. Regards,
Paul

In article <88sh5g$pf$1_at_perki.connect.com.au>,   "Tom Zamani" <tomz_at_redflex.com.au> wrote:
> You can not alter the next vale of a sequence, you need to drop it and
> recreat it.
> tom
> Ingvar Larsson <ingvar.larsson_at_gil-support.se> wrote in message
> news:R7fs4.7403$al3.97821_at_newsc.telia.net...
> > We have a sequence counter we wants to give new value for the next
> sequence
> > value.
> >
> > Example
> >
> > SELECT seqcnt.nextval FROM dual; returns 1
> >
> > Than we executes something like
> > ALTER SEQUENCE seqcnt NEXTVAL 20;
> >
> > and the next
> > SELECT seqcnt.nextval FROM dual; returns 20
> >
> > How do we do this?
> >
> > /Ingvar
> >
> >
> >
> >
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Feb 22 2000 - 11:47:09 CET

Original text of this message