Enform Plus Reference Manual
Links and the LINK OPTIONAL Statement Rules
Enform Plus Reference Manual—422684-001
C-3
Links Initiated by a WHERE Clause
Each term in a WHERE clause can contain subterms connected by the Boolean operator
OR. For example, consider the WHERE clause in the following query:
OPEN fruit, peach;
LIST ...
WHERE fruit.fuzz = peach.fuzz
OR fruit.color = "ORANGE";
The logical expression in this WHERE clause is also in conjunctive normal form. The
single term in this WHERE clause is:
fruit.fuzz = peach.fuzz OR fruit.color = “ORANGE” one term
Note that what appears as a term in your WHERE clause might not be a term in a
converted WHERE clause. Consider the WHERE clause in the following query:
OPEN fruit, orange, peach;
LIST fruit.color, orange.variety, peach.variety
WHERE (fruit.season = "summer" AND fruit.color
= orange.color) OR (fruit.season <> "spring" AND
fruit.fuzz = peach.fuzz);
Enform Plus converts this WHERE clause into conjunctive normal form as follows:
fruit.season = "summer" OR fruit.season <> "spring"
AND
fruit.season = "summer" OR fruit.fuzz = peach.fuzz
AND
fruit.color = orange.color OR fruit.season <> "spring"
AND
fruit.color = orange.color OR fruit.fuzz = peach.fuzz
When a WHERE Clause Establishes a Link
A WHERE clause establishes a link when an AND term in the converted WHERE clause
references two or more record descriptions. For example, consider the WHERE clause in
the following query:
OPEN apple, fruit;
LIST ...
WHERE fruit.color = apple.color;
The converted form of this WHERE clause contains a single term:
fruit.color = apple.color;
Because this term references two record descriptions (fruit and apple), the
preceding WHERE clause establishes a two-directional link between fruit and apple.