Page 1 of 1

Trim leading zero's

Posted: Tue Jun 08, 2010 11:23 am
by satheesh_color
Hi All,

I have an requirement to obtain the pricevalue from Oracle(Decimal 11,2) to create an dataset and this will be the source of MQSeries(JDA is the target system).

Eg:Input

00000000049.99
00000000159.90

Eg:Output

49.99
159.90

I just need a output as above,Please let me know your inputs on this.


Thanks,
Satheesh

Posted: Tue Jun 08, 2010 11:38 am
by anbu

Code: Select all

Trim(field,'0','L')

Posted: Tue Jun 08, 2010 11:58 am
by satheesh_color
Hi Anbu,

I failed to execute your input in my PX job(as the column as described in decimal(11,2).


Thanks,
Satheesh

Posted: Tue Jun 08, 2010 12:17 pm
by anbu
Can you post the error message?

Posted: Tue Jun 08, 2010 12:36 pm
by chulett
There won't be an error as while they may get trimmed, the Decimal datatype puts them right back. You'd need to target a Varchar if you didn't want the zeroes: DecimalToString()

Posted: Tue Jun 08, 2010 4:45 pm
by ray.wurlod
The leading zeroes are not significant. Don't worry about them. They are there to prove that precision and scale are being handled correctly. The internal representation, both in DataStage and in Oracle, is binary.

Posted: Tue Jun 08, 2010 8:08 pm
by chulett
... and yet we all know how much people like to worry, even about insignificant things. :wink: