Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help ! - How to resync sequence numbers to a table (Oracle)
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