Pakna wrote:

Why do I have a zero result on this query for all non-zero rows?

Simple: you have integer arithmetic here because your input data is integer.

31184 / 230944 = 0.1350

And that results in 0 because the fractions are simply ignored. If you want

to have a the digits behind the decimal separator, you have to convert at

least one of the parameters to FLOAT or DOUBLE:

SELECT DOUBLE(used_pages) / DOUBLE(free_pages)

FROM ...

And is there a way to make DB2 'ignore' division by zero and

just punch up a 0 result where such division is encountered so that I

can remove the where-clause?

Depends on your DB2 version. AFAIK, DB2 for zOS supports that. LUW doesn't.

--

Knut Stolze

DB2 Information Integration Development

IBM Germany