Previous Topic: Defining a ProcedureNext Topic: Procedure Parameters


Invoking a Procedure

You invoke procedures using an SQL CALL statement or using a query-specification or a SELECT statement. During SQL CALL processing, CA IDMS issues a call to the corresponding routines. The output parameter values return as a result set.

You can also reference a procedure in the FROM clause of a query-specification or SELECT statement, in the same manner as references to SQL tables, views and table procedures.

If you reference a procedure in a FROM clause, then the parameters of the procedure act as columns in an SQL table or view. You can reference them in SELECT list expressions and WHERE clauses. A procedure returns exactly one row of output or no output. You can reference procedures any place that permits a table reference.

Access to a procedure is controlled in the same way as for a table procedure. GRANT and REVOKE statements on a resource type of TABLE are used to give and remove SELECT or DEFINE privileges on a procedure.