Forum Discussion

GeorgePandiaraj's avatar
12 years ago

SQL query involving decimal number columns

Issue:
When I execute a SQL query that uses decimal value, SmartBear treats them as whole numbers when they are computed.

1. I have a test that will execute a SQL query on Tandem Non-Stop system and fetch the resultSet.
2. The query uses individual money fields and a computed money field:

Select ItemA, ItemB, ItemC, (ItemA + ItemB)
From TableA
Where Key1 = <value>

All fields – ItemA, ItemB, ItemC - are money fields (they store decimal values).

3. ResultSet
Assuming ItemA = 10.5, ItemB = 1.2, ItemC = 3.1

We would expect the resultSet to be:
ItemA = 10.5
ItemB = 1.2
ItemC = 3.1
(ItemA + ItemB) = 11.7

But, SmartBear is treating the computed column as whole number. The resultSet that I get is:
ItemA = 10.5
ItemB = 1.2
ItemC = 3.1
(ItemA + ItemB) = 11

The resultSet on Tandem for (ItemA + ItemB) is 11.7; however, on SmartBear it is 11.
I would appreciate any information that you may have on this issue.
Thanks
George
  • nmrao's avatar
    nmrao
    Champion Level 3
    Tried on oracle database which is seems to be absolutely fine.

    Query:
    select to_char(to_number('11.199', '99.999') + to_number('12.119', '99.999'), '99.999') from dual

    <Results>
    <ResultSet fetchSize="10">
    <Row rowNumber="1">
    <TO_CHARTO_NUMBER11.19999.999TO_NUMBER12.11999.99999.999> 23.318</TO_CHARTO_NUMBER11.19999.999TO_NUMBER12.11999.99999.999>
    </Row>
    </ResultSet>
    </Results>


    No idea about Tandem