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:
00522795
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?

Because of all the possibilities of optimistic buffering and other users editing the same record, changing data that make up unique keys, you are better off trapping the error. The best way is to have a surrogate integer PK field that can not be modified [or even be seen] by the user. Then use a PK generator to populate all your PK fields. Then use Candidate keys for user editable data and error trap those duplicates.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform