2011年7月21日星期四

Oralce Sum function in livelink

Found a big bug in livelink.

When excute oracle aggregate function SUM, livelink always truncate the value.

See this SQL
select sum(v)
from 
(
  select 1.01 v from dual
  union
  select 1.05 v from dual
)
pl/sql give 2.06 but livelink give 2.

The solution is (for livelink) convert decimal to string
select to_char(sum(v))
from 
(
select 1.01 v from dual
union
select 1.05 v from dual
)
It is very strange, isn't it?

没有评论:

发表评论