Quote:
|
Originally Posted by Marcus_A
No, there is no other way.
|
Exactly. DB2 can not know exactly how many rows a query will return. Even if you do a COUNT(*) first, this result is out-dated right away unless you use the very restrictive REPEATABLE READ/SERIALIZABLE isolation level.
Usually, an application that needs the exact number of rows has a design problem. You should just run your query and fetch rows until you get SQLCODE +100.