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: Help ! - How to resync sequence numbers to a table (Oracle)

Re: Help ! - How to resync sequence numbers to a table (Oracle)

From: Norman Dunbar <Norman_at_Dunbar-it.co.uk.REMOVETHIS>
Date: Fri, 18 Feb 2005 07:39:45 +0100
Message-ID: <cv45qn$mdv$1$8302bc10@news.demon.co.uk>


Zer0Frequency wrote:
> Thanks guys. Actually, the problem started because I can not make use
> of sequences during the mass load (just the nature of the problem)
> the code that generates the data has to maintain relational integrity
> and therefore generates its own sequences n stuff... but thats out of
> scope for this discussion anyway.
>
> So basically what I would have to do is after the load is done (and the
> sequence.nextval is still at 10, (while the data loaded has already
> reached 50000) - i would run a loop to keep incrementing the sequence
> and then leave it at that ...
>
> sounds good - let me give it a try.....
>
> Zer0Frequency
>

I might be a bit late to the party here, but have a look at changing the   increment of the sequence from 1 to some huge number that takes you over the MAX() value in the table. Extract the nextval from it and reset the increment to 1 again.

Something similar to

http://www.jlcomp.demon.co.uk/faq/resetseq.html

Cheers,
Norm. Received on Fri Feb 18 2005 - 00:39:45 CST

Original text of this message

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