DB2 Web Query record count
15 pts.
0
Q:
DB2 Web Query record count
Is there a simple way to show a count of the rows printed in DB2 Web Query, such as you can to in Query/400?
ASKED: Sep 30 2009  3:59 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
1840 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Is this what you are looking for?

your original query
SELECT .....
FROM ...
WHERE ...

then follow up with
SELECT COUNT(*)
FROM ...
WHERE ...

use the same FROM and WHERE clauses and it will give you a count.


Alternatively, does your product have access to the equivalent of the DB2 SQLCA? In the SQLCA, the first occurrence of SQLERRD contains the number of rows in the result set when you hit SQLCODE +100.
Last Answered: Sep 30 2009  7:07 PM GMT by Meandyou   1840 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

BUEHLER   15 pts.  |   Sep 30 2009  7:21PM GMT

Steve,

Thanks, but where would you enter this SQL in DB2 Web Query Report Assistant in order to show the count of # of rows on the report (to be similar to the row count in Query/400?

 

Meandyou   1840 pts.  |   Oct 1 2009  2:21PM GMT

Since I don’t know Web Query Report Assistant I can’t say where one would put it.

Could you use a UNION to append the COUNT to your original query?

SELECT …
FROM …
WHERE …
UNION
SELECT ‘value’ , COUNT(*)
FROM …
WHERE …
ORDER BY …

where ‘value’ is high value ( like x’FF’ ) to force that row to sort last

 
0