Hi,
I have source column float datatype mapped to Integer in target. I used AsInteger function in transformer to convert Float to Integer , as without conversion job was failing as I was mapping float to Integer.
After explicitly converting Float to Integer in target table field value is coming with negative sign e.g. source value :123 target value -123.
When I searched in forum, I got a post saying it is due to data over flow.
I checked table data( length of the column) It has maximum length 10 and I am running the process with very few records, so I made sure record length <=10.
Can anyone please let me know the reason.
Thank you in advance.
AsInteger conversion data issue
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 125
- Joined: Mon Sep 11, 2006 4:22 am
- Location: India
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Are you sure that the job is failing due to overflow? Or is it that you are getting a warning that mapping float to integer may cause overflow, and the actual cause of failure is something else?
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: 125
- Joined: Mon Sep 11, 2006 4:22 am
- Location: India
Thank you for response.
Yes, when I am mapping float source datatype to Integer in Target (I used a Copy stage in between) , it is giving error that, you are mapping float to int32 which might truncate data and job is failing failing. So I used AsInteger conversion .
Value in output is consistently coming negative, my question is why it is converting source value to negative value in target.
If I change target table to decimal (10,0) or float it gives proper value .
Please let me know if there is any solution of this issue.
Thanks
Yes, when I am mapping float source datatype to Integer in Target (I used a Copy stage in between) , it is giving error that, you are mapping float to int32 which might truncate data and job is failing failing. So I used AsInteger conversion .
Value in output is consistently coming negative, my question is why it is converting source value to negative value in target.
If I change target table to decimal (10,0) or float it gives proper value .
Please let me know if there is any solution of this issue.
Thanks
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Not all ten digit numbers can be integers. The largest possible signed integer is 2147483647, the largest unsigned integer is 4294967295. It's that fact that triggers the alert message. Any number larger than these will wrap around and be reported as negative. What are your actual values?
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: 125
- Joined: Mon Sep 11, 2006 4:22 am
- Location: India