To invoke a procedure
that is stored in a database, use the ESQL CALL statement. The stored procedure
must be defined by a
CREATE PROCEDURE statement that
has:
- A Language clause of DATABASE
- An EXTERNAL NAME clause that identifies the name of the procedure in the
database and, optionally, the database schema to which it belongs.
When you invoke a stored procedure with the CALL
statement, the broker ensures that the ESQL definition and the database definition
match:
- The external name of the procedure must match a procedure in the database.
- The number of parameters must be the same.
- The type of each parameter must be the same.
- The direction of each parameter (IN, OUT, INOUT) must be the same.
The following restrictions apply to the use of stored procedures:
- Overloaded procedures are not supported. (An overloaded procedure is one
that has the same name as another procedure in the same database schema with
a different number of parameters, or parameters with different types.) If
the broker detects that a procedure has been overloaded, it raises an exception.
- In an Oracle stored procedure declaration, you are not permitted
to constrain CHAR and VARCHAR2 parameters with a length, and NUMBER parameters
with a precision or scale, or both. Use %TYPE when you declare CHAR, VARCHAR
and NUMBER parameters to provide constraints on a formal parameter.