Trim with DecimalToString
Moderators: chulett, rschirm, roy
A Decimal column cannot/does not have leading zeroes. Could it be that your input is coming from a text file and is a string? In that case just one StringToDecimal() call is necessary.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 153
- Joined: Thu May 11, 2006 1:52 am
- Location: Bangalore
Thanks for the reply. You are right;the input comes from a file and in the sequential file's column definition I've mentioned it as Varchar 20, 4 and in the immediate transformer I'm mapping it where the column is Decimal 20,4 which is the expected format for the target Oracle table.
The data is 89 in the sequential file and since the column definition in the transformer is Decimal 20,4;the output link from the transformer will have will be having zeros preceding it. How can I solve this.
The data is 89 in the sequential file and since the column definition in the transformer is Decimal 20,4;the output link from the transformer will have will be having zeros preceding it. How can I solve this.
Take things step by step. If you do your StringToDecimal conversion and write the resultant decimal column to a PEEK stage, are your leading zeroes gone?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Decimal numbers are always displayed by the data browser and by Peek with leading and trailing zeroes. This mechanism allows you to verify that precision and scale are being accurately handled. Internally, of course, decimal numbers are represented as binary - just a pattern of bits.
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.