hello,
I have an issue here. I am doing a sql query from oracle enterprise stage.Here i am using some aggregate functions like count(*),sum(colmn1). Its meta data is defined as integer in the job. its throwing errors like floating point error. i dont hv the exact error message with me right now i wanted to know what data type does data stge understand when we take such functions, i tried with integer,decimal(38,10) and also double(as we use that in aggregator stage).sum function should by default have the data type of the column on which the sum function is working right??
Please advice me regd this.This is the issue with a lot of jobs with all of us dealing in this project.
Thanks
warnings --- floating point
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 53
- Joined: Fri Mar 07, 2008 1:17 am
warnings --- floating point
ETL DEVELOPER
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
Re: warnings --- floating point
datastagedw wrote:hello,
I have an issue here. I am doing a sql query from oracle enterprise stage.Here i am using some aggregate functions like count(*),sum(colmn1). Its meta data is defined as integer in the job. its throwing errors like floating point error. i dont hv the exact error message with me right now i wanted to know what data type does data stge understand when we take such functions, i tried with integer,decimal(38,10) and also double(as we use that in aggregator stage).sum function should by default have the data type of the column on which the sum function is working right??
Please advice me regd this.This is the issue with a lot of jobs with all of us dealing in this project.
Thanks
It simply returns double and if problem persists use any function to change the datatype to varchar or decimal. like to_char() or cast() after performing the operation
like
Code: Select all
select cast(sum(a) as decimal) as Column from XYZ
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.![Wink :wink:](./images/smilies/icon_wink.gif)
Genius may have its limitations, but stupidity is not thus handicapped.
![Wink :wink:](./images/smilies/icon_wink.gif)
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The Aggregator stage has a Decimal Output property both for the stage (as a default) and for each output field. From memory, I think its default value is "8,2". These numbers are precision and scale respectively.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.