8. OpenSQL Statements : EXECUTE PROCEDURE : Syntax
 
Share this page                  
Syntax
The EXECUTE PROCEDURE statement has the following formats:
Non-dynamic version:
[EXEC SQL] EXECUTE PROCEDURE [schema.]proc_name
              [(param_name=param_spec {,param_name= param_spec})] |
              [RESULT ROW (variable [:indicator_var]
{, variable[:indicator_var]})]
              [INTO return_status]
              [EXEC SQL BEGIN;program code;
              EXEC SQL END;]
Dynamic version:
[EXEC SQL] EXECUTE PROCEDURE [schema.]proc_name
              [USING [DESCRIPTOR] descriptor_name]
              [INTO return_status]
proc_name
Specifies the name of the procedure, using a literal or a host string variable.
param_spec
Is a literal value, a host language variable containing the value to be passed (:hostvar), or a host language variable passed by reference (BYREF(:host_variable)).