Changing field datatype from Double to Decimal
Moderators: chulett, rschirm, roy
Changing field datatype from Double to Decimal
Hi All,
Im getting a field which contains count of records from Aggregator stage and I need to change that field datatype from Double to Decimal. Can any one help me out in this.
Thanks in advance.
Im getting a field which contains count of records from Aggregator stage and I need to change that field datatype from Double to Decimal. Can any one help me out in this.
Thanks in advance.
Thanks,
Raamc
Raamc
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There is a global Decimal Output property in the Aggregator stage. As well any calculated column can override that with its own Decimal Output property. Specify precision,scale (that is, the precision value, a comma, and the scale value).
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
sud,
For the option 'Aggregation Type=count' in the aggregator stage the default datatype will be dfloat.
If you explicity change it to decimal, you will be getting a warning something like:
For the option 'Aggregation Type=count' in the aggregator stage the default datatype will be dfloat.
If you explicity change it to decimal, you will be getting a warning something like:
Code: Select all
Implicit conversion from source type "dfloat" to result type "decimal[38,0]": Possible range/precision limitation.
Thanks and Regards!!
dspxlearn
dspxlearn
Right, but that warning should be okay. It is just a indicator that a conversion is happening so that you did not do the conversion unintentionally. And, message handlers can be used to get rid of it. And, this suggestion is only for someopne who is unable to find what Ray suggested
Code: Select all
goto Aggregator stage --> properties --> click on: Aggregations and select additional property Default to decimal
Last edited by sud on Thu Feb 14, 2008 2:10 pm, edited 1 time in total.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
Ya. If we are going to use message handlers to suppress these kind of warnings, then its OK.
Raamc,
You have 2 options.
1. If you want a double datatype to be converted to decimal with a warning free job, keep the output datatype of the aggregator as double(default) and when you pass it to the later stages convert it to decimal by using the type conversion functions.
2. Explicitily change the datatype to decimal(p,s) and additionally supress the warning to log/demote the warning.
Raamc,
You have 2 options.
1. If you want a double datatype to be converted to decimal with a warning free job, keep the output datatype of the aggregator as double(default) and when you pass it to the later stages convert it to decimal by using the type conversion functions.
2. Explicitily change the datatype to decimal(p,s) and additionally supress the warning to log/demote the warning.
Thanks and Regards!!
dspxlearn
dspxlearn