SQL/MX Guide to Stored Procedures in Java (H06.04+, J06.03+)
Registering SPJs in NonStop SQL/MX
HP NonStop SQL/MX Guide to Stored Procedures in Java—540433-003
4-7
Specifying the Maximum Number of Result Sets
If the SPJ method passes character string values to or from an SQL/MP table that has
a KANJI (Japanese) or KSC5601 (Korean) column, use the ISO88591 character set for
the SQL parameter.
For more information, see character sets in the
SQL/MX Reference Manual
.
Specifying the Maximum Number of Result Sets
You can specify the maximum number of result sets that the SPJ can return using the
following syntax:
SPJ RS supports values of max-result-sets from zero up to and including 255. If
the DYNAMIC RESULT SETS clause is omitted, DYNAMIC RESULT SETS 0 is
implicit.
The actual number of result sets returned from a CALL statement, and the column
structure for those result sets, is not known to SQL/MX until the stored procedure body
executes.
When max-result-sets is a positive value, the Java method named in the CREATE
PROCEDURE statement must have one or more, not necessarily max-result-sets,
trailing parameters of type java.sql.ResultSet[ ]. The trailing Java parameters for result
sets must follow the Java parameters (if any) associated with the procedure's declared
SQL parameters.
If more than one matching Java method exists, by default SQL/MX does not attempt to
resolve the ambiguity, and an error is raised. This can happen when two or more
methods in the specified Java class have the same overloaded method name but differ
only in the number of trailing java.sql.ResultSet[ ] parameters. When a CREATE
PROCEDURE statement can potentially map to more than one Java method, users
must provide a full Java method signature in the EXTERNAL NAME clause to resolve
the ambiguity.
Note. The values ranging from zero to 255 are supported only on systems running J06.05 and
later J-series RVUs or on systems running H06.16 and later H-series RVUs.
On systems running J06.04 and earlier J-series RVUs or H06.15 and earlier H-series RVUs
SQL/MX throws an error if the value for max-result-sets is not zero.










