Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using sys(2015) for Unique keyvalues ?
Message
De
15/08/2003 19:57:56
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Using sys(2015) for Unique keyvalues ?
Divers
Thread ID:
00820691
Message ID:
00820691
Vues:
64
I am trying to decide whether to use sys(2015) to generate a unique primary key value for a table in one of my applications. In this particular case there would be less overhead, and it would be quicker and more simple than getting a 'next number' from a table that stores the next key value.

In Visual Accountmate, a VFP accounting package I work with, in some cases they use sys(2015) to generate unique numbers in some of their line item tables. I haven't ever run into any problems with reliability with this, or heard of anyone else running into a problem. I've looked for dupes in Accountmate tables with hundreds of thousands of rows, and never encountered any.

I've seen threads on here that talk about the reliability of using sys(2015) for temp file names - on fast computers etc. But I haven't seen any threads that address the issue of using it as a primary key.

When I proposed that we use it for a new application, one of the other developers I work with questioned me on whether I could guarantee that it would be unique, every time it was called, and what algorithm it used to guarantee uniqueness. I couldn't give him an answer. I think that it is based in part on the date and time. Beyond that I don't know.

Does anyone know the algorithm used to generate the sys(2015) string?

TIA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform