User guide

Connecting Record Descriptions to Form New Relationships
Developing an ENFORM Query
3–8 058058 Tandem Computers Incorporated
The number of resulting target records is 3 million, the product of the number of
record occurrences associated with a-rec and the number of record occurrences
associated with b-rec. If your query returns an unexpectedly large number of target
records, examine the links specified.
Use the following guidelines for links:
Link fields that belong to the same data category (either both numeric or both
alphanumeric). Fields that belong to different data categories cannot be linked.
Link on a full key or the left portion of a composite key; if the right portion of a
composite key (described in Section 2) is used, be sure it is necessary. Such a link
requires more processing time and might cause unexpected results.
Link fields that contain the same field values. Linking fields that do not contain
the same field values results in increased processing time and possibly unwanted
results.
Define only the links that your query needs. Defining more links than your query
needs can unnecessarily restrict the information returned. If necessary, clear
unwanted links.
Use efficient links. The most efficient links are usually between fields that are
primary keys, alternate keys, or fields that are described with a SEQUENCE IS
clause in the DDL record description.
The ENFORM statements, clauses, and commands used to connect, clear, and display
links are shown in Table 3-2.
Table 3-2. Establishing and Clearing Relationships
Statement Clause Command Function
LINK
LINK OPTIONAL
Creates a session-wide link; used to link
record descriptions for a query.
WHERE Creates a temporary link for the associated
LIST or FIND statement.
?SHOW LINK Displays session-wide links currently in
effect.
DICTIONARY
DELINK
DELINK OPTIONAL
CLOSE
?DICTIONARY Clears links from the internal table.
Making Session Wide Links ENFORM provides you with two statements that make session-wide links. These
statements are the LINK statement and the LINK OPTIONAL statement. While both
statements establish links, the link established by a LINK statement differs from the
link established by a LINK OPTIONAL statement. The following paragraphs discuss
both statements and describe their differences.