I could not find the db2 substitute for Oracle's %rowcount. Am using DB2 v 8.
I have a complex "search" query. I am using cursors here. I need to count the total number of records returned by the cursor and while opening the cursor I need to limit the number of rows between a given range( given thru input parameters). Everything is working fine. however the performance is too low.
The total time taken for the execution of the query is about 20 secs. I need to improve the performance asap.
currently what im doing is that counting the entire cursor using count(*) and again declaring the cursor and returning the result sets.
I am not sure whether there exists any alternate, better approach for the same requirement in db2 as I am new to db2.
Can any one suggest me? Thanks in advance.