Progress
SQL-92
Guide and Reference


DhSQLResultSet.set

Sets the field in the currently-active row of a procedure’s result set to the specified value (a literal, procedure variable, or procedure input parameter).

Format

public void set(int field, Object val)

Returns

None

Parameters
field

An integer that specifies which field of the result-set row to set to the value specified by val. (1 denotes the first field in the row, 2 denotes the second, and so on.)

val

A literal or the name of a variable or input parameter that contains the value to be assigned to the field.

Throws

DhSQLException

EXAMPLE

This code fragment illustrates SQLResultSet.Set:

CREATE PROCEDURE get_sal2 ()
RESULT (
     empname CHAR(20),
     empsal   NUMERIC,
)
BEGIN
     String ename = new String (20) ;
     BigDecimal esal = new BigDecimal () ;
     SQLCursor empcursor = new SQLCursor (
        "SELECT name, sal FROM emp " ) ;
     
     empcursor.Open () ;
     do
     {
        empcursor.Fetch ();
        if (empcursor.found ())
          {
               empcursor.getValue (1, ename);
               empcursor.getValue (2, esal);
               SQLResultSet.Set (1, ename);
               SQLResultSet.Set (2, esal);
               SQLResultSet.Insert ();
          }
     } while (empcursor.found ()) ;
     empcursor.close () ;
END 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095