Hello,
I have a table with item. Each item have a number. Everytime a new one is created, I get the highest nubber
an incremented with one.
Now I get a question of a customer that delete sometimes some items and want to assign the fist free number to the new item.
Now I first created a table with all the numbers and marked them for deleted and have a index on the itemnubmer and deleted().
My main index is on itemnumber and !deleted()
So when adding a new item I change my index to this index , go top and recall this record.
I was wondering if there is a easyer way to do this without first adding all empty items to this table.
I tested id by creating a loop with a seek until nothing is find, but that can take a while if there are over 100000 items.
I'm also using SQLite, so it can also be a SQL-command.
Thanks,
Marc