I have a Java function that invokes a DB2 stored procedure and expects a result set from a cursor. My problem is I want to do some other processing in that stored procedure, so I need to look at each row fetched, which doesn't work very well in a COBOL stored procedure with the cursor declared "FOR RETURN". If I don't declare the cursor this way, it returns a single result. I could build the entire result set in an array in the stored procedure, but it would be formatted wrong for Java to handle as a result set. I have seen similar samples using DB2 temporary tables, but the overhead of using them is prohibitive.
Does anyone know a way to accomplish this? What if I don't want to do any DB2 SQL in the stored procedure at all, I just want Java to think I did? If you have a way to do this that requires more time and effort than just a simple answer here, I can get you some compensation.
i don't understand the question - you can declare the cursor with return - and do work in the proc - all that has not been fetched will be fetched when back in caller program and declared the cursor on this return..
see here for some details ALLOCATE CURSOR statement
Best Regards, Guy Przytula
Database Software Consultant
Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
Information Server Datastage Certified http://www.infocura.be