Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Uniqueness of Indexes - how do you handle this?
Message
From
03/06/2000 15:54:34
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00376137
Message ID:
00376438
Views:
29
>>If you have Primary Key, which is not Integer (e.g. can be handled by GetNextKey procedure automatically), how do you ensure uniqueness of this PK in your forms? This PK could be one field (simplest case) or it could be combination of fields (more complicated case).
>
>Generate your own integer primary key behind the scenes, these are guaranteed to be unique.
>
>Natural keys are a headache because falliable users generate them and there can be exceptions to rules. Example social security number is a poor choice of primary key for a patient table. What is the patient is Canadian (no number). What if the patient is a baby with no number assigned yet? What if the person doesn't know their number.

Been there, done that. A temporary key is issued (and made sure it doesn't have a chance to be a double of someone's real key), and then if the person ever reappears with a real key, a procedure to reassign the new key was used... and it was a nightmare.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform