Page 1 of 1
Conversion from Decimal to varchar
Posted: Tue Sep 07, 2010 11:06 pm
by kalpanam
Hi,
I'm facing problem in converting Decimal(9,0) to Varchar(20).My design is as below:
DB2 stage------->Modify stage------>DB2 stage
In modify stage I have specified as INTERNET_ORDER_NBR=string_from_decimal (INTERNET_ORDER_NBR)
I'm getting output as
049351929.
049342258.
But the required output is
49351929
49342258
Can anyone help me how to get this result..
Thanks,
KalpanaM
Re: Conversion from Decimal to varchar
Posted: Tue Sep 07, 2010 11:30 pm
by behrouz
if you get 0xxxx as your input link
you can transtype your decimal to integer then it will be like xxxx and then transtype it to string
the other option is do a simple maping by transformer do not use modify
Arash
Posted: Wed Sep 08, 2010 1:46 am
by ray.wurlod
What you get and what you expect are equivalent. Decimal representation in DataStage includes leading and trailing non-significant zeroes and placeholder to prove that precision and scale are being managed correctly. You can remove each with Trim() functions or, if you are 100% certain that there are always eight significant digits, with substring operator.
Posted: Wed Sep 08, 2010 2:02 am
by kalpanam
ray.wurlod wrote:What you get and what you expect are equivalent. Decimal representation in DataStage includes leading and trailing non-significant zeroes and placeholder to prove that precision and scale are being m ...
no when I queried the DB2 table using IBM data studio 2.2,I'm getting the result displayed as
049351929.
049342258.
but the required output should be
49351929
49342258
Thanks & Regards,
Kalpana.
Posted: Wed Sep 08, 2010 4:30 am
by ray.wurlod
Read all of my response.
Premium membership is not expensive, at less than 30c (Rs12) per day.