Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parents, do you know where your Children are?
Message
 
To
01/03/2000 03:18:39
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00339639
Message ID:
00339649
Views:
26
Mike,

Parent and child are relative terms that refer to two tables involved in a relationship. The term parent is the table from which the relationship originates and the child is the target of the relationship. These terms are often misused through the assumption that they are permanently assigned to a specific table at some point.

Example;
USE Invoice
USE LineItems IN 0 ORDER InvNo
SET RELATION TO InvNo INTO LineItems
* Above, Invoice - parent    LineItems - child

CLOSE ALL
USE LineItems
USE Invoice IN 0 ORDER InvNo
SET RELATION TO InvNo INTO Invoice
* This one is LineItems - Parent    Invoice - Child
Another way to see it is that the Parent is the controlling table and the child is the controlled table.

The role of parent/child in a relationship may vary depending on the current situation. For example, we may define a persistent relationship between Customer and Invoice, Invoice and LineItems, and LineItems and Inventory. However we need a report that shows Inventory items and lists the custoemrs that bought them. Our environment would be;
Inventory (Parent)
  LineItems (Child to Inventory  Parent to Invoice)
    Invoice (Child to LineItems   Parent to Customer)
      Customer (Child to Invoice)
This is exactly the opposite to the persistent relationships.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform