DB2 Web Query record count

20 pts.
Tags:
DB2
DB2 Web Query
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?

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • BUEHLER
    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?
    20 pointsBadges:
    report
  • Meandyou
    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
    5,220 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following