FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » deleted primary key can't be reused?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: deleted primary key can't be reused? [message #181831 is a reply to message #181827] Sat, 08 June 2013 19:32 Go to previous messageGo to previous message
Norman Peelman is currently offline  Norman Peelman
Messages: 126
Registered: September 2010
Karma:
Senior Member
On 06/08/2013 10:24 AM, 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.
>

That's not necessarily how it works. If you think about what you are
saying you should come to the realisation that the database would have
to reorder all the higher keys every time you deleted something. Not
good. You -can- reuse 'empty' indexes by either manually inserting the
new data or programming to look for them when inserting data, again not
good. You are better off to let the database do its job and let it
manage the keys/indexes for you.

--
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Read info from webcam video
Next Topic: PHP form generator
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 00:32:07 GMT 2024

Total time taken to generate the page: 0.04300 seconds