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

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-179
SELECT Statement
number of specified host variables, and the data type of each source value must
be compatible with the data type of its target host variable. The first value in the
result row is assigned to the first host variable, the second value to the second
variable, and so on.
You can specify rowset host variables in variable-spec. If you specify one
rowset host variable, all specified host variables in the INTO list must be rowsets.
Multiple rows can be returned when rowsets are used. If the number of rows
returned is less than the length of the rowset, no error is displayed. However, if the
number of rows returned exceeds the length of the rowset or the specified rowset-
size-out, NonStop SQL/MX displays an error.
Use the INTO clause only for operations that are not union operations and return
no more than one row. If the SELECT statement returns more than one row, use
rowset host variables in the INTO list, or use a cursor.
: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 values in the result row
of the SELECT statement are returned in these host variables.
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.
See single-row SELECT statements in the SQL/MX Programming Manual for C
and COBOL.
FROM table-ref [,table-ref]...
specifies a list of tables, views, derived tables, or joined tables that determine the
contents of an intermediate result table from which NonStop SQL/MX returns the
columns you specify in select-list. To refer to a table or view, use one of these
name types:
Guardian physical name
ANSI logical name
DEFINE name
See Database Object Names on page 6-12.
If you specify only one table-ref, the intermediate result table consists of rows
derived from that table reference. If you specify more than one table-ref, the
intermediate result table is the cross-product of result tables derived from the
individual table references.
C/COBOL
C/COBOL