I want to convert my Varchar(9) field to Numeric(9), but I am not able to do that in TFM stage with StringToDecimal Function. So plz help me in this...
Regards,
Kunal Shah
Unable to convert the Varchar(9) to Numeric(9)
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 11
- Joined: Thu Feb 10, 2011 1:09 am
- Location: Kuala Lumpur
-
- Participant
- Posts: 40
- Joined: Mon May 11, 2009 12:19 am
- Location: Madurai
-
- Premium Member
- Posts: 238
- Joined: Fri Jul 25, 2008 8:55 am
Alrt ...so here is the issue...
e.g. you are having a varchar '777777777' and you are converting and copying to decimal 9 using stringTodecimal and might have declared the legnth of your decimal field as 9 and scale 2.
now the string function will convert your function to 777777777.00
so see the total length of the converted value, it's 11.
Will it fit? it wont fit.... so datastage will show you 00000000 with a warning...
so now you know what to do... change the length and scale of target decimal field, it will work for sure.
e.g. you are having a varchar '777777777' and you are converting and copying to decimal 9 using stringTodecimal and might have declared the legnth of your decimal field as 9 and scale 2.
now the string function will convert your function to 777777777.00
so see the total length of the converted value, it's 11.
Will it fit? it wont fit.... so datastage will show you 00000000 with a warning...
so now you know what to do... change the length and scale of target decimal field, it will work for sure.
-
- Premium Member
- Posts: 238
- Joined: Fri Jul 25, 2008 8:55 am
hmm..chulett wrote:They've already posted the issue and the fact that it was resolved, so unsure why you are bringing scale into the picture, it doesn't really seem relevant here.
Actully while I was replying and posting the reply the issue got solved...
![Smile :)](./images/smilies/icon_smile.gif)
well.. I faced a similar issue and all 000000 was because of the length and scale... so the intention was to help...