Pathmaker Programming Guide

Creating a DB Requester Application
Pathmaker Application Development Overview
067868 Tandem Computers Incorporated 3–25
Multifile Considerations. Before you create a multifile DB requester application, you need
to make sure that:
The files used (that is, the DDL records or SQL table objects) contain related
information.
Those files contain matching fields.
You cannot mix NonStop SQL tables and Enscribe files in a DB requester.
When fields from two files match, they can be used as link fields (sometimes called
join fields) that establish a logical connection between the two files. When you
generate an application based on a multifile DB requester, each file must have at least
one link field that can be used to associate it with another file.
Note Enscribe allows you to create a file with a group data item as a primary key. Likewise, NonStop SQL
allows you to create a table with more than one column declared as the primary key for the table.
A link field for a Pathmaker DB requester that accesses Enscribe files can be a group data item; however,
a link field for a Pathmaker DB requester that accesses NonStop SQL tables must be a single column.
In the employee-client example, the employee file and the client file each contain an
employee number field, identical in length and type, that is used to link these files.
The way in which you link files in a multifile DB requester will determine the order in
which they will appear on the screen and the order in which the application can read
or insert records for the associated boxes. This order establishes a dependency
between the files. The application must use the link field value of a record from one
box to read or insert a record for the other box. Access to a record in the second box
depends upon the presence of a record that has a matching link field value in the first.
Because this dependency is similar to the relationship that exists between a parent and
a child, one of the boxes connected by a link field is called a parent box and the other
is called a child box. (In a DB requester that accesses three or more files, a file can
simultaneously be both a child and a parent.)
The end user can read or insert a record for a child box only if a record for the parent
box has already been read or inserted.
Note If an application displays several boxes, it is important to remember that:
The end user must perform a read or insert operation on a containing box before performing any
operation on a box nested within it.
If the end user does not use the application carefully, inconsistencies can be created in the
database. For example, the end user could delete a parent record and leave orphaned child
records remaining in the database, or the end user could update a parent record and change the
value of its link field, making child records that contained the old link field value unaccessible.