Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting records using REPLACE
Message
From
25/01/2000 02:31:57
 
 
To
24/01/2000 17:46:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00321564
Message ID:
00322056
Views:
23
>Pascal, this is what I do. I use integer fields for keys. When I want to "delete" a record, I set the key value to the negative of itself.
>
>REPLACE TABLE.iKey with -TABLE.iKey.
>
>This will never cause a non-unique value.
>
>I do this for the primary key and all of the foreign keys. I DON'T actually DELETE the record. I have SET DELETED OFF.
>
>Works for me.

2 comments :
- in this case the mentioned index is not a primary key issue : it's only set up to prevent records with a duplicate key (how can you prevent that 2 users try to add the same keyvalue at exactly the same time)
- I'm always wondering how someone work things out with SET DELETED OFF. Really can't imagine how you handle things elegantly this way ...
Previous
Reply
Map
View

Click here to load this message in the networking platform