Try OpenEdge Now
skip to main content
SQL Development
Stored Procedures and Triggers : Writing stored procedures : Using the OpenEdge SQL Java classes : getValue method: pass values from SQL result sets to variables
 
getValue method: pass values from SQL result sets to variables
The getValue method of the SQLCursor class assigns a single value from an SQL result set (returned by an SQL query or another stored procedure) to a procedure variable or output parameter using the following syntax:
Syntax
getValue ( col_num , sql_data_type ) ;
col_num
Specifies the desired column of the result set as integer. getValue retrieves the value in the currently fetched record of the column denoted by col_num. 1 denotes the first column of the result set, 2 denotes the second, n denotes the nth.
sql_data_type
Specifies the corresponding SQL data type.
This method returns a Java object that must be cast to the corresponding SQL data type. This example shows how the getValue() method works:
cnum = (Integer) NEWROW.getValue(1, INTEGER);
cnname = (String) NEWROW.getValue(1, CHARACTER);