execute
Execute a prepared statement
Syntax
execute_stmt:
EXECUTE stmt_name [INTO var_name[, var_name]...]
Description
The EXECUTE statement is used to execute a statement that was successfully compiled by a previously executed PREPARE statement. The INTO clause is only used when the statement associated with stmt_name is a SELECT statement that returns a single row and the specified var_name list identifies the variables into which each column of the fetched result set row will be stored. The number of variables specified must match the number of columns in the result row and each must be declared with the same (or compatible) data type as its associated result column. If stmt_name refers to a previously prepared SELECT statement then that statement must return only a single row. If not an exception is raised.
Example
set stmtstr = "SELECT * FROM ACCTMGR WHERE mgrid = '" || newId || "'"; prepare s2 from stmtstr; execute s2 into c_id, c_name, c_hired, c_commission; select stat, c_id, c_name, c_hired, c_commission; deallocate prepare s2;
See Also