Hi
I have got a varchar field of length 12,2. When data(say 16.25) is populated in it comes as 000000000016.25.
I want to get it as 16.25,without any zeros being padded in left. Please help.
Regards
Arnie
Problem with varchar field
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You have a Decimal field, not a VarChar field. (16,2) is not valid for VarChar. If, having converted this to a string there are leading zeroes, this is how DataStage does things. It displays leading (and trailing) zeroes to demonstrate that decimal precision and scale are being handled properly. Internally, of course, they are represented in a binary format.
To convert the "0" characters to " " characters or "" characters in the string the most efficient function to use is Convert().
To convert the "0" characters to " " characters or "" characters in the string the most efficient function to use is Convert().
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.