Seems working!!!!
Thanks a lot!
Ping
-----Original Message-----
From: barohrbacher
[mailto:db2udbdba-ezmlmshield-x19825628.[Email address protected]
Sent: Monday, October 24, 2005 10:03 AM
To: LazyDBA Discussion
Subject: Re: Help DB2 8.1 on AIX
Have you Tried putting decimals around each calculation?
SELECT
dec(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),7,4)
+ dec(ROUND(ROUND(ROUND(4.04942+4.38641,4)/2,4)* 0.85 ,4),7,4)
FROM PSCLOCK
"Chu Ping "
<db2udbdba-ezmlms
hield-x84646397.x
To
[Email Address Removed] "LazyDBA Discussion"
A.com> <[Email address protected]
cc
10/24/2005 09:03
AM
Subject
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.
---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
DB2 & UDB email list listserv db2-l LazyDBA home page