Enform Plus Reference Manual

Links and the LINK OPTIONAL Statement Rules
Enform Plus Reference Manual422684-001
C-7
Examples of Invalid Links
Examples of Invalid Links
The following examples involve query specifications that use the sample data base
shown in the Enform User's Guide. The purpose of these examples is to show invalid
links, not to show useful queries. Each example includes a sketch of its links. The
following symbols are used for the sketches:
The links in the following query specifications are invalid because they violate rule 1:
LINK region TO employee VIA regnum;
LINK employee.empnum TO OPTIONAL order.salesman;
LINK order TO region VIA regnum;
LIST regname, empname, ordernum;
A sketch of these links appears as follows:
region employee
order
In the preceding example, order (the record description on the right side of the LINK
OPTIONAL statement) is linked back to employee by the transitive property of links.
The query specifications in the following example violate rule 1. These query
specifications illustrate the fact that Enform Plus evaluates a link established by a
WHERE clause in the same manner that it evaluates a link established by a LINK
statement:
LINK region TO employee VIA regnum;
LINK employee.empnum TO OPTIONAL order.salesman;
LIST regname, empname, ordernum
WHERE order.regnum = region.regnum;
A sketch of these links appears as follows:
region employee
order
Represents a one-directional link initiated by a LINK OPTIONAL
statement.
Represents a two-directional link initiated by either a LINK statement
or a WHERE clause.
Represents a two-directional link canceled by a LINK OPTIONAL
statement.