Multiple Result Sets from DB2 stored Procedure

Multiple Result Sets from DB2 stored Procedure

Post by siv » Sun, 10 Nov 2002 02:20:25



Hello,

 When I tried to access multiple resultsets from Db2 stored Procedure
(IBM OS/390), everything is fine until we scroll into each of the
fields counts in the record set.  If the record sets are different in
terms of number of fields, whatever available for the first record set
is getting propogated to the rest of the recordsets.  If the first
record set has only 2 fields even if the subsequent records have more
than 2 fields, only first 2 fields I am able to access, rest of the
fields if we try to access it is throwing an exception.

 It looks like the meta data is not getting propogated to the
subsequent record sets.

 The code roughtly looks like this

   rs = cmd.execute()

   do until rs.eof
   ...
   loop

   rs = rs.nextRecordset

   do until rs.eof
   ...
   eof

   Reassigning to different recordset everytime also doesnt help much.

Any help to resolve the same will be greatly appreciated,

thanks,
Siva