To define a relation

  1. On the Product Line Definition form or the File Definition form of the Database Definition tool, press Define (F6) and choose Relations.

    The Relation Definition form appears. The product line defaults from the previous form.

    Field Description
    File Name

    Primary ("From") file for the relation.

    If you access the Relation Definition form from the File Definition form, the File Name field defaults from the File Definition form.

    Relation Name

    Relation name.

    If you are defining a new relation, type a name that is descriptive of the relation. For example, if you are defining a one-to-many relation that states a department can have several employees, you might name the relation Employees.

    Related File Secondary ("To") file. The file the primary file is related to.
    Access Index

    Index that relates the primary file to the secondary file.

    The default is the first index for the related (secondary) file.

    Condition Name Optional. Type a condition name if you want the relation to include only the records that satisfy the condition.
    Relation Type

    Type of relation: One-To-One or One-To-Many.

    Required Scheme

    Scheme, for a one-to-one relation: Required or Not Required.

    Deletion Scheme

    Deletion scheme, for one-to-one, not-required relations, or for one-to-many relations: Delete Ignored, Delete Cascades, or Delete Restricted.

  2. Move the cursor to the detail area.

    The detail area displays the key fields of the related file for the selected index.

  3. Press Select (F4) or Define (F6), and choose fields or values to match the access keys.

    Match all of the access keys on one-to-one relations. Leave at least one access key without a match on one-to-many relations.

    Choose To
    File Field Select a field from the primary file. The field must be the same type and size as the index field.
    Dependent Field Select a field from a dependent file (a file that has a one-to-one relation from the primary file and a one-to-one relation to the related file). The field must be the same type and size as the index field.
    Value

    Type a constant value. The value must be the same type and no larger than the size of the index field.

    You can give a value only to a field with a size of 14 or less. If a field size is larger than 14, the system assigns default values: spaces for alpha-type fields and zeros for numeric-type fields.

  4. Press Enter twice to save the relation definition.