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 Wiki Answer Submitted: September 30, 2009 7:07 pm by Meandyou5,205 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
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?
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?
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