Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Sequences ?
Martin Fuks wrote
> Do you know how to syncronize a sequence with the maximum
> value in a field in a table?
If it is just a few records, you could simply execute a loop with
select my_sequence.next_val
from dual;
until you reach the maximum value that exists in your table. If it is more than just a few rows then you'd need an alter sequence to set the increment_by part, select a next_val only once and again issue an alter sequence to get the original sequence behavior.
Please let us know how many tables are involved, for I did have some script to do this but would need to restore a backup to get it for you.
Arjan. Received on Fri Apr 23 1999 - 09:46:18 CDT
![]() |
![]() |