Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Primary keys useless?
Message
From
02/09/1997 18:03:03
Biju Varghese
M.H Alshaya Co W.L.L
Kuwait, Kuwait
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00047863
Message ID:
00048129
Views:
23
Hi Jim, Please could you explain me how u arrived the figure 2,000,000,000. For surrogate PK, I usually take the recc() and add 1 to it then, convert it to the base 36 and store. I do this by giving Default Value of PK as Base36( recc()+1 ). Where Base36 is an UDF which converts decimal to base 32. Is there a better way of doing this? TIA, Biju > The enforcement of PK and Candidate indexes is according to the rules of > relational databases. The rules state that a Primary or candidate key is > absolutely Unique within the table. Set deleted on does NOT remove the > record from the table, the record is still there and still has that key, > and the record could be recalled in the future So the behavior you see is > the only way it could ever work. > > To solve the perceived problem with this, use surrogate keys so you don't > care what the value is as long as it is unique. Don't ever reuse a key. > If you use Integer field for this you are limited to only 2,000,000,000 > positive values stored in 4 bytes.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform