I need to determine the number of rows returned from a DB2 v6.1 Query in a CICS pgm – with the following caveats:
1. use a CURSOR (DECLARE, OPEN, FETCH, etc.)
2. make one SQL call – minimize I/O
3. NO dynamic SQL
4. NO stored procedures
This would be a no brainer in any other DB (SQL Server, Oracle et al.) yet DB2 does not appear to support a special register like %COUNT% ouside of using stored procedures. The have a GET STATISTICS command in stored procedures that returns the rows affected by the previous SQL statement.
Anyone have any thoughts on how to accomplish this ?
TIA