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
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