ALLBASE/SQL Reference Manual (36216-90216)

Chapter 11 421
SQL Statements E - R
EXECUTE PROCEDURE
EXECUTE PROCEDURE
The EXECUTE PROCEDURE statement invokes a procedure.
Scope
ISQL or Application Programs
Syntax
EXECUTE PROCEDURE [:
ReturnStatusVariable
= ][
Owner.
]
ProcedureName
[ ( [
ActualParameter
][, [
ActualParameter
]][...]) ]
Parameters
ReturnStatusVariable
is an integer host variable, or, for a prepared EXECUTE
PROCEDURE statement, a dynamic parameter, that receives the return
status from the procedure.
ReturnStatusVariable
can only be used
when invoking a procedure from an application program, and it is always
an output variable.
[
Owner
.]
ProcedureName
specifies the owner and the name of the procedure to execute. If
an owner name is not specified, the owner is assumed to be the current
DBEUserID.
ActualParameter
specifies a parameter value that is passed into and/or out of the
procedure. The syntax of
ActualParameter
is presented separately
below.
SQL Syntax—ActualParameter
[
ParameterName
= ]
ParameterValue
[OUTPUT[ONLY]]
Parameters—ParameterDeclaration
ParameterName
is the parameter name.
ParameterValue
a value that is passed into and/or out of the procedure.
For an input only parameter, the value can be any expression that does not
include any aggregate function, add_months function, LONG column
function, TID function, local variable, procedure parameter, or built-in
variable. Column values are allowed only when the EXECUTE PROCEDURE
statement is defined in a rule.
For an OUTPUT or OUTPUT ONLY parameter, the value must be a single
host variable, or in a prepared EXECUTE PROCEDURE statement, a single
dynamic parameter.
You can omit a parameter in calling the procedure by using a comma by
itself, which is equivalent to specifying a value of NULL or the default (if