Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append Blank
Message
De
25/09/1996 09:52:10
Paul Wei
Fib, State of Michigan
Lansing, Michigan, États-Unis
 
 
À
23/09/1996 11:05:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00008443
Message ID:
00008541
Vues:
29
>I'm attempting to use the append blank method
>of inserting a record into a table but the referential
>integrity is stopping me because before the fields
>are populated the record violates all kinds of rules.
>Any suggestions?

Try this Chris.

Assume you have a Master table and a Child table related by key fields K1 and K2. Go to the database dictionary, modify the Child table by plugging in the following default values for K1 and K2:

For K1: iif(used('master'),master.k1,'')

For K2: iif(used('master'),master.k2,'')

Now when a blank Child record is generated and if the Master table is in use somewhere, then the Master's K1 and K2 values will be placed in the child's K1 and K2 fields and your referential intergrity is preserved. If the Master table is not in use when the Child record is created, then the Child's K1 and K2 will be Null's and you'll be no worse off then before.

Paul
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform