Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Increasing primary key integers in a table
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00138182
Message ID:
00138390
Vues:
11
>>I [assign a PK] in the Record Validation Rule; if the key field is empty, I determine an appropriate value for the key and REPLACE the key with it.
>
>Interesting. What would you say is the benefit to doing it then, instead of making the key determination the default value?
>
>A drawback that I can see is that you don't find out what your PK is until TableUpdate(), and I have one app where I add both parent and child records at the same time. The child needs to know the parent's PK right away.

If the PK won´t ever be seen by the user, then you could generate it anytime. Anyway, I also have programs with parent/child records, and after generating the PK for the parent I go and REPLACE its value in the children.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform