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

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-133
EXECUTE Statement
When EXECUTE with INTO executes, NonStop SQL/MX stores information into
the host variables (and optionally their indicator variables) that correspond to
columns specified in the select list for the prepared statement.
:variable-name [[INDICATOR] :indicator-name]
is a variable specification—a host variable with optionally an indicator variable.
A variable name begins with a colon (:).
The data type of an indicator variable is exact numeric with a scale of 0. If the
data returned in the host variable is null, the indicator parameter is set to a
value less than zero. If character data returned is truncated, the indicator
parameter is set to the length of the string in the database.
{USING | INTO} SQL DESCRIPTOR descriptor-name
identifies the SQL descriptor area for the parameters of SQL-statement-name.
An SQL descriptor area must be currently allocated whose name is the value of
descriptor-name and whose scope is the same scope specified in the
EXECUTE statement.
Before EXECUTE with USING executes, the application must store information for
each input parameter of the prepared statement in the descriptor area. Each
parameter has an item descriptor.
When EXECUTE with INTO executes, NonStop SQL/MX stores information into
the descriptor area about each column specified in the select list for the prepared
statement. Each column has an item descriptor.
descriptor-name
is a value-specification—a character literal or host variable with
character data type. When EXECUTE executes, the content of the value
specification (if a host variable) gives the name of the descriptor area.
See PREPARE Statement on page 2-159, SET PARAM Command on page 4-47, and
MXCI Parameters
on page 6-73.
C/COBOL