Previous Topic: EXECUTENext Topic: Parameter Marker Replacement


Description

statement-name

Identifies the prepared statement to be executed. The prepared statement must have been prepared within the same logical unit of work as the EXECUTE statement used to execute it, and it cannot be a select-statement. (Prepared select-statements are executed with OPEN statements.) See PREPARE for more information about prepared statements.

USING

If the prepared statement includes parameter markers, you must code the USING clause. The USING clause specifies either a list of host variables (whose values are substituted for parameter markers) or a SQL Descriptor Area (SQLDA) that contains a description of the host variables. If you code the USING clause when there are no parameter markers in the prepared statement, the USING clause is ignored. See Rules for Parameter Markers for rules for parameter markers. Information about parameter marker replacement can be found on PREPARE.

host-variable

Identifies host structures or variables used to supply the values for parameter markers. Separate the host variables in the list with commas.

The host-variable specified in the USING clause identifies a structure or variable that is described in the program in accordance with the rules for declaring host structures and variables. When the statement is executed, a reference to a structure has been replaced by references to each of its variables. The number of variables must be the same as the number of parameter markers in the prepared statement. The nth variable supplies the value for the nth parameter marker in the prepared statement.

DESCRIPTOR descriptor-name

The descriptor-name identifies a SQL Descriptor Area (SQLDA) containing a description of the host variables. The SQLD field (used to indicate the number of variables) must be set to the number of parameter markers in the prepared statement, and the length of the SQLDA (indicated by SQLABC) must be sufficient to describe that number of variables. The nth variable (the nth SQLVAR entry) described by the SQLDA corresponds to the nth parameter marker in the prepared statement. For details on the SQLDA, see SQL Descriptor Area (SQLDA)