ENFORM User's Guide
Connecting Record Descriptions to Form New Relationships
Developing an ENFORM Query
058058 Tandem Computers Incorporated 3–11
For example, consider the following:
OPEN region,employee;
LINK region.manager TO OPTIONAL employee.empnum;
Figure 3-6 shows the record occurrences associated with both the region and the
employee record descriptions. This figure also shows the logical record occurrences
built for the LINK OPTIONAL statement. Notice that some of the logical record
occurrences contain blanks for the fields from the employee records. These fields are
blank because no employee record matches the particular region record. For example,
ENFORM includes the region record occurrence where manager has a value of 29 even
though there is no matching record occurrence in employee.
Figure 3-6. Diagram of LINK OPTIONAL Where Region is Linked to Employee
regname manager
Region Record Occurrences
1
29
43
• • •
343
HEADQUARTERS
EAST
GERMANY
• • •
CANADA
empnum empname
Employee Record Occurrences
1
23
32
43
• • •
343
ROGER GREEN
JERRY HOWARD
THOMAS RUDLOFF
PAUL WINTER
• • •
ALAN TERRY
ROGER GREEN
PAUL WINTER
• • •
ALAN TERRY
regname manager
Logical Records
1
29
43
• • •
343
HEADQUARTERS
EAST
GERMANY
• • •
CANADA
empnum empname
1
43
• • •
343
LINK OPTIONAL
Appears to Create
New Logical Records
If the order of the record descriptions in the preceding LINK OPTIONAL statement is
reversed:
LINK employee.empnum TO OPTIONAL region.manager;
the resulting logical record occurrences are very different. As Figure 3-7 shows,
ENFORM includes all the employee records in the logical record occurrences even
though a matching region record does not exist; however, ENFORM does not include
any region record that does not match an employee record.