Although in Oracle DB its is allowed to parametrize the number of rows that the query can fetch by adding to the query:
select ...
from ...
where ...
and rownum <= @MaximumRecords
I can't add similar condition to acuivalent query running in DB2: It is allowed to add:
select ...
from ...
where ...
fetch first 500 rows only
(where there is fixed number of rows) but not:
select ...
from ...
where ...
fetch first :1 rows only
(:1 == @MaximumRecords)
Is someone aware of a solution/work-around to this problem?