Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper Way To Check For Duplicate Primary Key
Message
 
À
22/06/2001 22:11:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00522709
Message ID:
00523336
Vues:
11
>What is the most efficient way of handling this?
>Assuming I have a compound PKEY or CANDIDATE
>should I do a SEEK before modifying a one of
>the components or is it more efficient to trap
>for the error?
>
>   ...kt

Really IMHO the proper way to do this is to generate the primary key yourself, and make sure its unique when generated. This means either use a table to keep track of keys generated for each table, or come up with a key routine that will always give you a unique value, something along the lines of SYS(0)+SYS(2015) which should pretty much guarantee a unique value.
Cy Welch
Senior Programmer/Analyst
MetSYS Inc
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform