SQL/MX Programming Manual for Java
SQLJ Syntax
HP NonStop SQL/MX Programming Manual for Java—523726-003
A-4
Executable Clause
result set, and the Java types in the iterator declaration must be compatible
with the positionally corresponding SQL column types in the result set.
named-iterator
specifies a list of Java identifiers preceded by their associated Java data types,
where the pairs are separated by commas and the list is enclosed in parentheses:
(Java-data-type Java-ID [,Java-data-type Java-ID]..)
specifies the data types and names of the columns in the iterator. The names
must match the names of the corresponding columns in the result set for the
query. The match is not case-sensitive.
The columns in the iterator do not need to be in the same order as the columns
in the result set, and the number of columns named in the iterator can be less
than the number of columns in the result set.
Executable Clause
An executable clause is either an SQL statement or an assignment clause. An
executable clause can begin with a context-clause, which specifies either a
connection context or an execution context or both. The context clause is optional.
context-clause
contains the name of the instantiated connection context object and/or the
execution context object within square brackets (
[]). For information about context
objects, see Connection Contexts on page 3-8 and Execution Contexts on
page 3-20.
If you use a context clause before a FETCH statement or an assignment clause
containing an SQLJ CAST statement, the SQLJ translator program returns a
warning. FETCH and CAST statements are not included in the profile and instead
are translated to JDBC method calls on the associated iterator class.
statement-clause
specifies an SQL statement. See Statement Clause on page A-5.
assignment-clause
assigns the result set from a SELECT statement to an iterator. See Assignment
Clause on page A-5.
executable-clause is:
[
context-clause] { statement-clause | assignment-clause }
context-clause is:
"["
connection-context "]"
| "["
execution-context "]"
| "["
connection-context,execution-context "]"