Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sys(2015) for primary key.
Message
 
To
21/12/1996 17:09:30
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00015796
Message ID:
00015798
Views:
35
>>I've been using sys(2015) as the field default for certain unique keys. Am I asking for trouble? I'm not sure how sys(2015) generates the string and for how long I can expect to keep getting unique strings..
>>Any other ideas for unique keys?
>
>Yes, some people are using that technique.
>
>However, the more used one is by using a data dictionary table that hold the actual key of each table and some others used fields. By having that table, you can also apply a locking mecanism which will garantee to always have a unique key.

We did some experimentation with sys(2015), when trying to decide the same question. This was under fpw 2.6. We found that 2 users can generate the same sys(2015) key within the same 1/100 th of a second.
Also sys(2015) is time/date based, so if your master clock is reset backwards, sys(2015) will generate duplicates. Based on this info, we decided this was not a good primary key or unique indicator. This is probably still true of VFP.

HTH
Glenn
Glenn
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform