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 |