A question to the pros....
I've got a parallel job that is reading numbers (figures) from a varchar2 field of an oracle table and converting those figures into decimal(38,2) dataset field using the function stringtodecimal within a transformer.
When I check the dataset, the column contains only values like this 000000000000.00. I suspect that it may be related to some values that are not decimals (ex 23, 45, 78 ) but it's converting all the values into 000000000000.00 including the values the are decimals (43435.45, 234000.00).
Any clues?
Thanks
StringToDecimal Conversion issue
Moderators: chulett, rschirm, roy
StringToDecimal Conversion issue
A bad fishing day is much better than a great day at work
-
- Participant
- Posts: 9
- Joined: Tue Feb 16, 2010 1:18 am
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
Throw a few down a peek stage giving the before and after values. Put quotes or brackets around the before value to see if there are spaces (I'm not one to remember how the function treats spaces...)
If still not obvious, convert the before value to hex and see if any non-numeric non-display characters are lurking
If still not obvious, convert the before value to hex and see if any non-numeric non-display characters are lurking
Hi Guys,
Thanks for the tips. They helped me to pip point the issue.
Basically, the data files had chr(13) at the end of a few fields.
So, I what I did to resolve this problem was to remove this character using the function "trim(field, char(13))" and let the transformer do an implicit conversion from varchar to decimal (38,2).
Appreciate the help from this forum.
All the best.
Mchaves
Thanks for the tips. They helped me to pip point the issue.
Basically, the data files had chr(13) at the end of a few fields.
So, I what I did to resolve this problem was to remove this character using the function "trim(field, char(13))" and let the transformer do an implicit conversion from varchar to decimal (38,2).
Appreciate the help from this forum.
All the best.
Mchaves
A bad fishing day is much better than a great day at work
-
- Premium Member
- Posts: 892
- Joined: Thu Oct 16, 2003 5:18 am