Autonumber in a Sequence after Export/Import
496733Nov 20 2006 — edited Nov 20 2006Hi,
I have a sequence running in a DB, which increments an ID field. The problem comes up, when I need to backup/restore the DB. What I need then is a SQL script, which would allow me to set the MinValue to the max used value +1 (or + 100). Unfortunately something like
Create Sequence XXX.Mytable
Increment by 1
MinValue (SELECT MAX(COUNTERID) from XXX.Mytable);
MaxValue 1E+27
Cache 20;
does not work. So what is best practise to handle this case. I found many people posting this question, but no simple answer. Does anybody have one?
Thank you in advance
Pawel