To do this, you'll have to have a few SQL commands run for every insert. First, the command needs to check to see if there is an ID greater than 1000. If there is , then you'll need to DELETE the first ID number, re-start the ID number sequence, and then INSERT the new data. If it's less than 1000, just INSERT it in.
Getting back that ID number can be problematic. It's do-able in MYSQL and Access that I know of, I'd wager PostgreSQL has a LastAutonumberEntered or the like somewhere in the docs. If not, try timestamping, and then searching for that timestamp (records entered less than, say, 1 minute ago) or searching on a different possibly unique field. I'd recommend wrapping all this in a transaction, for obvious reasons.
----Asim, known to some as Woodrow.
In reply to Re: Cycle through primary key with DBI
by Asim
in thread Cycle through primary key with DBI
by lestrrat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |