SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-132
EXECUTE Statement
The module that contains EXECUTE must also contain a PREPARE statement for
statement-name.
USING param-value [,param-value]...
specifies values for the unnamed parameters in the prepared statement. The data
type of a parameter value must be compatible with the data type of the associated
parameter. Parameter values are substituted for unnamed parameters in the
prepared statement by position—the i-th value in the USING clause is the value for
the i-th unnamed parameter in the statement.
If there are more values in the value list than there are unnamed parameters in the
PREPARE statement, NonStop SQL/MX ignores the extra values; if there are fewer
unnamed values in the value list, NonStop SQL/MX returns an error.
The values for any named parameters in the prepared statement must be
previously specified with SET PARAM commands.
param-value
is a numeric or character literal that specifies the value for the parameter. The
param-value can also be the NULL keyword. You must enter it in uppercase
letters. If param-value is a character literal and the target column is character,
you do not have to enclose it in single quotation marks. Its data type is determined
from the data type of the column to which the literal is assigned.
ext-statement-name
is a value-specification—a host variable with a character data type. When
EXECUTE executes, the content of the value specification must identify a
statement previously prepared within the scope of EXECUTE.
GLOBAL | LOCAL
specifies the scope of the prepared statement. The default is LOCAL. A GLOBAL
prepared statement can be executed within the SQL session. A LOCAL prepared
statement can be executed only within the module or compilation unit in which it
was prepared.
A prepared SQL statement must be currently available whose name is the value of
ext-statement-name and whose scope is the same scope as specified in the
EXECUTE statement.
{USING | INTO} variable-spec [,variable-spec]...
identifies the host variables for the parameters of SQL-statement-name.
Before EXECUTE with USING executes, the application must store information for
each input parameter of the prepared statement in the appropriate host variable.
MXCI
MXCI
C/COBOL
C/COBOL
C/COBOL