The object type File Relation documents relationships between files. The relationship is established by means of references to fields.
This document covers the following topics:
The following topics are covered below:
For general information on how to manage objects (for example, how to add or copy an object), see the Predict Object Description documentation.
The table below contains a list of all valid file relation types.
Code | File Relation Type |
---|---|
C | Two files of type A are physically coupled. |
D | The file relation is only documented. |
K | Common keys. This file relation type is only
valid for file types YT and YV (Sybase tables and views). The field linked to
the file relation must have a non-blank descriptor type. Predict checks whether
the number, formats and character sets of the fields - or source fields in the
case of superdescriptors - in file 1 and file 2 agree. For Sybase, you can generate a common key from a file relation of this type. For other database management systems, file relations of this type are used for documentation purposes only. |
N | This file relation type documents the models used by Natural Construct. See Defining File Relations for Objects in Predict in the Natural Construct User's documentation. |
R | Ref. Constraint. Files of type AT, BT, D, JT, OT, X, XT, XV, Y, and YV are connected by referential integrity. |
S | Files of type A are soft coupled. |
When you add a file relation, you first have to specify the file relation type in the New Predict Object dialog box.
When you choose the
button, a file relation type-specific window appears. The file relation type is indicated in the title bar.The parameters listed below can be found on the following tabs: File Relation Attributes, Construct Usage and Constraint Attributes.
Note:
Parameters not listed here are described under
Global
Attributes.
Parameters | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Cardinalities |
|
||||||||||||||||
Primary File/Field | One of the related files. If the type of file relation is R, the field which is used to link this table must be a unique descriptor or ISN (Adabas), a primary index (for DB2) or a unique key (for other SQL systems). | ||||||||||||||||
Secondary File/Field | The other related file. If the type of
file relation is R, the
field which is used to link this table must be one of the following:
|
||||||||||||||||
Minimum | The minimum number of occurrences of a field from the primary or secondary file in the file relation. | ||||||||||||||||
Average | The average number of occurrences of a field from the primary or secondary file in the file relation. | ||||||||||||||||
Maximum | The maximum number of occurrences of a field from the primary or secondary file in the file relation. | ||||||||||||||||
Constraint Attributes | |||||||||||||||||
Update type |
|
||||||||||||||||
Delete type |
|
||||||||||||||||
Constraint name | The constraint name for a file relation of type D and R. For files of type A, the constraint name must follow the Adabas short name conventions. For details refer to Field Names in Record and Field Definitions of the section Adabas Design in the Adabas Concepts and Facilities documentation. | ||||||||||||||||
Enforce | Only applicable to file relations of type D or R. Specifies whether or not the referential constraint is enforced by DB2 during normal operations such as insert, update or delete. Check the box to enforce the referential constraint.. | ||||||||||||||||
Construct Usage | |||||||||||||||||
Usage |
|
The validity checks performed by Predict depend on the file relation type:
Type | Applicable for | Validity Checks |
---|---|---|
Physically Coupled | Adabas | May not be any of the following:
|
Type | Applicable for | Validity Checks |
---|---|---|
Documented | all types | None |
Type | Applicable for | Validity Checks |
---|---|---|
Common Keys | Sybase tables and views | The field linked to the file relation must have a non-blank descriptor type |
Type | Applicable for | Validity Checks |
---|---|---|
Natural Construct | all types | Both the field and file containing the file relation must be defined in Predict. |
Type | Applicable for | Validity Checks |
---|---|---|
Referential Constraint |
Adabas File |
Must be marked in the table of file 1: For file type DB2 table or Informix table/view:
Must be marked in the table of file 2: for file type Adabas file:
|
Type | Applicable for | Validity Checks |
---|---|---|
Soft-coupled | Adabas | May not be any of the following:
|