Examples Of Legal Links - Tandem ENFORM 058057 Reference Manual

Data management library
Table of Contents

Advertisement

LINKS and the LINK OPTIONAL Statement Rules
Review of Rules for the LINK OPTIONAL Statement

Examples of Legal Links

C–10
The following examples contain legal links that might appear to be illegal. These
examples also include a sketch of their links. The symbols used for the sketches are
the same as those used for the illegal link examples.
The following query specifications contain a LINK OPTIONAL statement and a
WHERE clause:
LINK employee TO OPTIONAL region VIA regnum;
LIST empname, employee.regnum
WHERE employee.regnum <> region.regnum;
A sketch of these links appears as follows:
employee
The link initiated by the WHERE clause might appear to violate rule 1. Remember,
however, that when ENFORM checks the legality of a link, a LINK OPTIONAL
statement "cancels" any two-directional link between the same record descriptions.
ENFORM does use this two-directional link when evaluating the query.
The following query specifications contain two LINK OPTIONAL statements:
OPEN employee, order, odetail;
LINK employee.empnum TO OPTIONAL order.salesman;
LINK order TO OPTIONAL odetail VIA ordernum;
LIST empname, order.ordernum, partnum, quantity;
A sketch of these links appears as follows:
employee
At first glance, you might assume that these links violate rule 2 because odetail appears
on the right side of the first as well as the second LINK OPTIONAL statement. This is
not the case. Rule 2 states that a record description appears on the right side of more
than one LINK OPTIONAL statement only if a two-directional link exists between it
and another record description on the right side of a LINK OPTIONAL statement.
Since the one-directional LINK OPTIONAL statement links order and odetail, odetail
only appears on the right side of the second LINK OPTIONAL statement.
058057 Tandem Computers Incorporated
region
order
odetail

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enform

Table of Contents