Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 4 Processing Data : FORALL Processing

FORALL Processing
A FORALL statement is a looping construct that processes a set of occurrences. The body of the loop consists of the statements to be executed for each occurrence satisfying the selection criteria. FORALL statements can be nested provided that they refer to different table names.
Rows are returned to TIBCO Object Service Broker in the order in which CA‑IDMS passes them. If you require a different order, you must include an ORDERED clause in your FORALL statement. TIBCO Object Service Broker orders only rows specified in the selection criteria.
The first record defined in the access path is retrieved from CA‑IDMS based on the selection criteria specified and whether the definition is parameterized. The remaining records defined in the access path are retrieved from CA‑IDMS based on the set specified in the table definition and on selection criteria specified for elements of the remaining records.
Non-parameterized Table Access
The first record defined in the access path of a non-parameterized table is retrieved as described in the following table:
Equality operator specified on a CALC key element defined as the TIBCO Object Service Broker primary key.
>, <, >=, <=, or = operators specified on a sort key element or on part of a composite sort key.
Position within the index or set and walk index or set until all record occurrences satisfying selection criteria are found.
Selection criteria specified on an element that is not a sort key or index
Selection criteria specified on a CALC key that is not defined as the TIBCO Object Service Broker primary key
Walk the set or sweep the area until all record occurrences that satisfy the selection criteria are found.
When selection criteria are specified for both non-key IDMS/DB elements and key IDMS/DB elements (that is, CALC, sort key, and index elements), the Gateway does the following:
Parameterized Table Access
A FORALL request on a parameterized table always results in an OBTAIN CALC request being sent to CA‑IDMS to access the first record defined in the IDM table definition.
Retrieving the Remaining Records
The remaining member records defined in the access path are retrieved as described in the following table for both non-parameterized and parameterized tables:
Selection criteria specified on an element that is not a sort key
Walk the set until all record occurrences that satisfy the selection criteria are found.
>, <, >=, <=, or = operators specified on a sort key element or part of a composite sort key.
Position within set and walk the set until all record occurrences satisfying selection criteria are found.
When selection criteria are specified for both IDMS/DB sort key elements and non-key IDMS/DB elements, the Gateway does the following:
If there is more than one set in the access path, the Gateway positions itself within each set, where possible, based on the above table.
Remaining owner records defined in the access path for both non-parameterized and parameterized tables are retrieved with an OBTAIN OWNER request using the specified set name. Selection criteria specified on elements of the owner record are evaluated after the owner is retrieved.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved