Hi,

I have a table which includes a column "customorder integer primary key
autoincrement" which I use to address rows in the table.

When I delete a row, I renumber the remaining rows so that the key remains
continuous (to match my GUI display). However, when I subsequently insert a
new row, the auto-generated key starts from the old maximum. Is there a way
to reset the autoincrement counter so that after deletions and insertions,
the counter remains continuous? Or do I have to maintain my own unique row
identifier?


E.g. my table starts like:

  rowa|56|text|1
  rowb|41|wers|2
  rowc|67|none|3
  rowd|92|attr|4
  
then I delete a couple of rows and renumber, so it becomes:

  rowa|56|text|1
  rowd|92|attr|2
  
when I insert a new row, I'd like it to have a key value of 3, but
instead I get 5:

  rowa|56|text|1
  rowd|92|attr|2
  rowz|55|bobb|5


Thanks a lot,
Adam

-- 
Adam Richardson
Carpe Diem

Reply via email to