Help DB2 8.1 on AIX

Help DB2 8.1 on AIX

 

  


We are trying to execute this below sql in DB2 Sql which is supposed to
calculate the arithmetic expression and return the value.

SELECT ROUND(ROUND(3.723+4.9056+0.09,4)
+ROUND(ROUND(ROUND(4.296+5.3744+0.09,4) -
ROUND(3.723+4.9056+0.09,4)/5,4)*0.15,4),4) +
ROUND(ROUND(ROUND(4.04942+4.38641,4)/2,4)*0.85,4) FROM PSCLOCK

It is giving us arithmetic overflow issue. If we split the sql to two
pieces it is working fine. But we cannot execute this as one. We tried
TRUNC instead of ROUND ,but no effect. This SQL is formed dynamically in
the App Oracle Database is able to handle these kind of equation pretty
easily without even using ROUND or TRUNC... Engine and we have little
control on splitting it. The idea is not to solve this particular
equation but a solution which can execute any kind of formula ( some are
tougher than this).

Appreciate if any of you can help us with any solutions.

DB2 & UDB email list listserv db2-l LazyDBA home page