SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
E-7
EXECUTE Statement
EXECUTE Statement
EXECUTE is a dynamic SQL or SQLCI statement that executes an SQL statement
previously compiled by the PREPARE statement.
{ stmt-name }
{ :stmt-variable }
specifies the compiled statement to execute by the name assigned to it in the
PREPARE statement.
stmt-name is the name. Use this form to specify the name in SQLCI or in
programs.
:stmt-variable is a host variable of SQL type CHAR or VARCHAR that contains
the name. Use this form to specify the name only in programs.
[ USING [ ?param=] value [, [?param =] value ] ... ]
[ USING :variable [, :variable ] ... ]
[ USING DESCRIPTOR :in-sqlda ]
specifies values for parameters in the compiled statement. Use the first form in
SQLCI, the second form in a program that has information about the parameters,
and the third form in a program that uses DESCRIBE INPUT to dynamically
retrieve information about the parameters.
Whatever form you use, these rules apply:
You must supply a value for each parameter in the statement to be executed
that does not currently have a value, including all unnamed parameters.
The data type of a parameter value must be compatible with the data type of
the associated parameter.
EXECUTE { stmt-name }
{ :stmt-variable }
[ USING [?param=] value [, [?param=] value ]... ]
[ USING :variable [ , :variable ] ... ]
[ USING DESCRIPTOR :in-sqlda ]
[ RETURNING { :variable } ]
[ { USING DESCRIPTOR :out-sqlda } ]
value is:
{ literal }
{ CURRENT_TIMESTAMP }
{ COMPUTE_TIMESTAMP }