Walking a Set
A program using navigational DML or CA IDMS/DB in response to an SQL request can access all of the members of a chained set in the following manner: starting with the owner record occurrence, a program can use the next pointers to access each member occurrence in the chain until the program reaches the owner record again. Accessing members in a chain in this way is known as "walking a set."
Assume that the DEPT-EMPLOYEE set in the sample database is a chained set sorted by employee identification number (EMP-ID-0415). To retrieve an occurrence of the EMPLOYEE record, a program could issue the following requests:
MOVE '0050' TO DEPT-ID-0410 OBTAIN CALC DEPARTMENT. OBTAIN NEXT WITHIN DEPT-EMPLOYEE SET.
Processing the Request
CA IDMS/DB processes this request as follows:
Retrieving an Owner
A program can issue the following request to retrieve an occurrence of the DEPARTMENT record associated with an employee:
MOVE '0019' TO EMP-ID-0415. OBTAIN CALC EMPLOYEE. OBTAIN OWNER WITHIN DEPT-EMPLOYEE SET.
Processing the Request
CA IDMS/DB processes this request as follows:
|
Copyright © 2014 CA.
All rights reserved.
|
|