Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Surrogate primary key
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00138968
Message ID:
00139093
Vues:
15
>>We are using Visual FoxPro 5.0. We want to use tables with a primary surrogate key. We would like to know how to do that and if it is possible in FoxPro 6.0 to use an automatic surrogate primary key (autonumbering).
>
>No, it's not possible, unfortunately. You'll have to take care of this yourself.
>
>The way that many people do it is to have a Keys table, with one record for each other table, that contains the value for the next PK. I like to put a call to a procedure in the default value for each table's PK, that goes to the Keys table, gets the next PK, increments it, and returns it (with the necessary record locking, of course). That way, it _appears_ as if autonumbering is being done, since any new record will receive a proper PK, without worrying how that new record is added.

Thank you for your answer!
Greetings,

Afier Appelman
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform