Example 1: Orders within Company
The Owned by relation may be used to specify the high order key of a file. Let us say that you operate a multi-company sales ledger and that all orders are within company.
A Company could be defined as follows:
FIL Company REF Known by FLD Company code CDE
FIL Company REF Has FLD Company name TXT
An Order could be defined as follows:
FIL Order REF Owned by FIL Company REF
FIL Order REF Known by FLD Order code CDE
FIL Order REF Has FLD Order date DT#
This specifies that the key of the Company file is the high order key of the Order file, which results in the following entries:
|
|
Company |
|
|
Order |
|
K |
Company code Company name |
|
K K |
Company code Order code Order date |
Example 2: Orders within Company within Country
Owned by relations may be used to construct a hierarchy. In the example given above, the Owned by statement asserts that the keys of Company are the high order keys of Order. If you later decide that a Company is only unique within Country, then adding Country to the Company file with an Owned by relation will automatically add it to the Order file. The presence of the relation stating Order is Owned by Company causes the automatic addition.
A Country could be defined as follows:
FIL Country REF Known by FLD Company code CDE
FIL Country REF Has FLD Company name TXT
Company could then be redefined as follows:
FIL Order REF Owned by FIL Company REF
FIL Order REF Known by FLD Company code CDE
FIL Order REF Has FLD Company name TXT
The definition of Order requires no change:
FIL Order REF Owned by FIL Company REF
FIL Order REF Known by FLD Order code CDE
FIL Order REF Has FLD Order date DT#
This results in the following entries, where you can see the Country code has been introduced automatically onto the Order file:
|
|
Country File |
|
|
Company File |
|
|
Order File |
|
K |
Country code Country name |
|
K K |
Country code Company code Company name |
|
K K K |
Country code Company code Order code Order date |
|
Copyright © 2014 CA.
All rights reserved.
|
|