Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append Blank
Message
From
25/09/1996 09:52:10
Paul Wei
Fib, State of Michigan
Lansing, Michigan, United States
 
 
To
23/09/1996 11:05:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00008443
Message ID:
00008541
Views:
28
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform