Re: EDS db_replace_key()
- Posted by Andy Serpa <ac at onehorseshy.com> Feb 21, 2005
- 423 views
Salix wrote: > > I tried to create something similar but it screwed > up the record numbers somehow. It actually does not > replaces the 'record key' but deletes the 'old record' > and inserts a 'new record'. > In EDS, record numbers are only temporary (subject to change every time you insert or delete a record). Records are sorted by key, which is how they are numbered, so if you "change a key" for a record, the record number will also change unless it happens to maintain the exact same position in the sorted order. For this reason, a db_replace_key() confuses the issue -- you really should just delete the record and then re-insert it with the new key, keeping in mind that the record number will most likely change...