Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Network:
Windows 2003 Server
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement