SQL/MX 3.2.1 Guide to Stored Procedures in Java (H06.26+, J06.15+)
Table 3 Mapping of SQL/MX Data Types to Java Data Types (continued)
Maps to Java Data Type...SQL/MX Data Type
double (or java.lang.Double if specified)***DOUBLE PRECISION
* The character set for character string data types can be ISO88591 or UCS2.
** Numeric data types must be SIGNED, which is the default in NonStop SQL/MX.
*** By default, the SQL/MX data type maps to a Java primitive data type. The SQL/MX data type maps to a Java
wrapper class only if you specify the wrapper class in the Java signature of the EXTERNAL NAME clause. See the Java
Method Signature (page 64).
This icon indicates an SQL data type that is an SQL/MX extension to the ANSI standard. All other SQL data
types in this table conform to the ANSI standard.
For information about SQL/MX data types, see the SQL/MX Reference Manual. For cross-references
to appropriate manuals for mappings of SQL/MX data types to compatible data types in calling
applications, see Chapter 5: Invoking SPJs in NonStop SQL/MX.
Character String Parameters and Character Sets
For SQL parameters that have character string data types, you can specify either ISO88591 or
UCS2 (Unicode) for the character set. This example uses UCS2 as the character set of the SQL
parameter named lastname:
(IN empnum INT, OUT lastname CHAR(25) CHARACTER SET UCS2)
If you do not specify a character set, the default is ISO88591:
(IN empnum INT, OUT lastname CHAR(25))
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.
NOTE: 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.
The actual number of result sets returned from a CALL statement and the column structure for those
result sets are 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.
Using the CREATE PROCEDURE Statement 63










