Previous Topic: STORENext Topic: MODIFY


CONNECT

The CONNECT function explicitly links an existing occurrence of the member record type to other records within a set. This function is used after storing a new record in order to link it into a set whose membership option is Manual. It can also be used to link an existing record into a set after it has been disassociated from another set occurrence.

The user program prepares for a CONNECT function by establishing correct currencies for the member record being connected and for the set occurrence to which it is being connected. If the set order is FIRST, LAST, or SORTED, the current of set can be any record within the set. If the set order is NEXT or PRIOR it may be necessary to establish currency on a specific record before issuing the connect function.

For example, June Moon is joining the MIS department. We will add her EMPLOYEE record to the DEPT-EMPLOYEE set owned by the MIS department. Because the set order is sorted by last and first names, MIS, Peter Plum, Sandy Shore, or John Done can be current of set; June Moon is always linked after John Done because of the relative value of her last name. If the set order was NEXT or PRIOR and a member's position in the set is important, then the program must ensure that the correct record occurrence is current of set.

The program must also ensure that a member in the correct set occurrence is current. If Spiro Tutuo, a member of the DEPT-EMPLOYEE set owned by the Sales department, is the current of set when the CONNECT function is issued, then June Moon will appear to be a member of the Sales department rather than the MIS department.

The record, when connected, becomes current of run unit, current of its record type, current of its area, and current of all sets in which it participates.

The following figure illustrates storing and connecting records in our sample database. In this example, we want to add a new employee, June Moon. She will work as a programmer in the MIS department. The example illustrates the following steps: