Establishes a relationship between open tables so that moving the record pointer in the parent table moves the record pointer in the child table.
SET RELATION TO [eExpression1 INTO nWorkArea1 | cTableAlias1 [, eExpression2 INTO nWorkArea2 | cTableAlias2 ...] [IN nWorkArea | cTableAlias] [ADDITIVE]]
Specifies the relational expression that creates a relationship between the parent and child tables. The relational expression is usually the index expression of the controlling index of the child table.
If eExpression1 is numeric, it is evaluated when the record pointer in the parent table is moved. The record pointer in the child table is then moved to record number eExpression1.
Omitting arguments for SET RELATION removes all relationships in the currently selected work area. You can remove a specific parent-child relationship using SET RELATION OFF. For more information, see SET RELATION OFF Command.
- INTO nWorkArea1| cTableAlias1
Specifies the work area number or table alias of the child table.
- eExpression2INTO nWorkArea2| cTableAlias2...
Specifies a relational expression and the work area number or a child table alias so you can create an additional relationship between the parent table and child tables. Precede each relationship definition with a comma.
- IN nWorkArea
Specifies the work area of the parent table.
- IN cTableAlias
Specifies the alias of the parent table.
The IN clause makes it possible for you to create a relationship without first selecting the parent table's work area. If you omit nWorkArea and cTableAlias, the parent table must be open in the currently selected work area.
Preserves all existing relationships in the current work area and creates the specified relationship. Omitting ADDITIVE breaks any relationships in the current work area and creates the specified relationship.