Re: deleted primary key can't be reused? [message #181903 is a reply to message #181827] |
Fri, 21 June 2013 17:52 |
Marc van Lieshout
Messages: 10 Registered: March 2011
Karma:
|
Junior Member |
|
|
On 08-06-13 16:24, richard wrote:
> Entered 100 items into 2 columns each.
> Deleted 2.
> Upon entering new record using id of 98, no can do.
> The next new record number becomes 101.
> "Duplicate key error" is issued.
> How do I take back the deleted key number so I can use it again?
> No, I do not mean the data that is in the record.
> To me, once a record is deleted, the key index should reflect that the
> record no longer exists, so the key index should be -1 of what it was.
> Not continue its esistance.
>
This is related to a problem I had once: I wanted a special record in a
table with id 0.
insert into <table> (id, ...) values (0, ....);
didn't work; the insert was succesful, but with ID 1. Then I executed:
update <table> set id = 0 where id = 1;
That solved the problem.
|
|
|