When and how many times a component is invoked
The INVOKE clause is a SQL statement. It is executed under exactly the same conditions as a SQL statement without INVOKE.
How many times a component is invoked depends on a combination of things, especially on the SQL syntax construction, the context in which it is executed, and the protocol used. The application developer needs to be aware that not all combinations of input and output are appropriate in all contexts.
•If the INVOKE clause is used independently, the component is invoked once.
•In the INVOKE ... WITH SELECT ... construction, INVOKE is executed as many times as there are records in the result table of the SELECT statement.
•In the INVOKE ... WITH INVOKE ... construction:
•In the INVOKE ... WITH INVOKE component.method() construct, the first INVOKE is invoked once.
•In the INVOKE ... WITH INVOKE component.query-protocol() construction, the first INVOKE is executed once for every record returned by the query protocol.
The following typical RDMI examples will give you a feel for when components are invoked, and how many times.