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


Chapter 3 Tools : FORALLE

FORALLE
Releases internally the resources used by FORALLA on a table. (C)
Invocation
CALL FORALLE(table)
 
Name of a table involved in a previous FORALLA or FORALLB call. Its syntax is C (fixed-length character string) with length of 16.
Usage Notes
There are a maximum of 16 tables that can be actively accessed with FORALLA and FORALLB per transaction. An index is maintained for each table being accessed by FORALLA and FORALLB, and there is a maximum of 16 simultaneous indexes per transaction. FORALLE clears the index for the specified table, and frees up resources for another table to be accessed. When you are finished accessing a table with FORALLA or FORALLB, you should call FORALLE to indicate that you are finished and free up resources for another table to be accessed.
Example
The following rule uses FORALLA and FORALLB to retrieve all the occurrences in the MIDWEST parameter instance of the EMPLOYEE table and put them in the message log. FORALLE is used to clean up the table index when the loop exits normally or when an exception is raised. All the exception handlers call FORALLE, so that all ending points for the FORALLA, FORALLB sequence are covered by a FORALLE.

 
FORALLE_1;
_
_ ---------------------------------------------------------------------------
_ --------------------------------------------------------------------+------
_ CALL FORALLA('EMPLOYEE', '07MIDWEST', '', ''); | 1
_ UNTIL TABLEEND: | 2
_ CALL MSGLOG('EMPLOYEE ' || EMPLOYEE.LNAME || |
_ ' IS NUMBER ' || EMPLOYEE.EMPNO); |
_ CALL FORALLB('EMPLOYEE'); |
_ END; |
_ CALL FORALLE('EMPLOYEE'); | 3
_ --------------------------------------------------------------------------
_ ON TABLEEND :
_ CALL FORALLE('EMPLOYEE');
_ CALL MSGLOG('NO OCCURRENCES WERE FOUND.');
_ ON SECURITYFAIL:
_ CALL FORALLE('EMPLOYEE');
_ CALL MSGLOG('A SECURITYFAIL WAS RAISED');
_ ON LOCKFAIL:
_ CALL FORALLE('EMPLOYEE');
_ CALL MSGLOG('A LOCKFAIL WAS RAISED');
_ ON DEFINITIONFAIL:
_ CALL FORALLE('EMPLOYEE');
_ CALL MSGLOG('A DEFINITIONFAIL WAS RAISED');

 

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