Progress
SQL-92
Guide and Reference
SQLCursor.getValue
Assigns a single value from a SQL result set to a procedure variable. The single field value is the result of an SQL query or the result from another stored procedure.
Format
public Object getValue( int
fieldNum, short
fieldType)
Returns
Object
Parameters
fieldNum
An integer that specifies the position of the field to retrieve from the fetched record.
fieldType
A short integer that specifies the data type of the parameter. The allowable defined values for
fieldType
are listed in Table 6–3, grouped by category of data type.
Throws
DhSQLException
NOTES
EXAMPLE
- Before invoking getValue, you must test for the null condition by calling the SQLCursor.wasNULL method. If the value returned is null, you must explicitly set the target variable in the stored procedure to null.
- The getValue method returns a value from the result set identified by the number you specify in the
fieldNum
parameter. getValue returns the value as an object of the datatype you specify in thefieldType
parameter. Since getValue returns the result as an instance of class Object, you must explicitly cast your return value to the correct datatype.- If the returned value is of datatype CHARACTER, then getValue returns a Java String Object. You must declare a procedure variable of type String and explicitly cast the value returned by getValue to type String.
This example illustrates testing for null and invoking the Java getValue method:
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |