Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Uniqueness of SYS(2015)
Message
De
24/06/2007 20:55:22
 
 
À
24/06/2007 20:04:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01235219
Message ID:
01235274
Vues:
18
Pertti,

>True, since SYS(2015) is derived from the workstation clock, and workstations on networks are never completely synchronized. It is a pretty sure-fire unique value on one single system, though -- running SYS(2015) in a tight loop on my 3.4 Pentium with 2GB memory did not produce any duplicates during 1000 iterations, though. But a GUID would give you a truly unique ID, every time.

Actually, I tried doing the same with 10 workstations simultaneously appending a central table with their SYS(2015) generated values. So far, no duplicates arose. I really just wanted to be sure.

>The LastPKID() -strategy has a few important benefits, however: While it is a bit more (setup) work than simply getting a GUI, with this approach you can create integer keys, which take a whole lot less space than GUI and are a whole lot faster to search (in a huge data table).

To be safe, I guess I will just to my GetLastNumber() stuff. I was hoping to use SYS(2015) instead to cut off another layer of 'fat'.

>I don't personally completely trust the autoincrement -field property in VFP -- it has problems specifically if you use views or stored procedures. Also, since the current autoinc value is stored in the table header, it is at risk during crashes.

Me neither.

Thanks!
Dennis
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform