Page 1 of 1

string to Decimal conversion

Posted: Thu Dec 28, 2006 5:12 am
by vij
hi all,

I have an issue after i convert string to decimal..

this is the derivation for the column which is of decimal 5 as length and precision as 1, "if condtn then (stringtodecimal(column1[4,2])) else null" .

i dont understand how i can get a value 0490.0, for the input 000490.
It has a space as the first character in the output. how can it store a character (space) in a decimal field?

pls help me in solving this..

Re: string to Decimal conversion

Posted: Thu Dec 28, 2006 5:43 am
by mpouet
Hi alone,

The first character is reserved for the sign... For example -0490.0.
This is not a problem with ODBC connection nether OCI plug in. If you store this decimal in a sequential file, use a CHAR/VARCHAR type.

Matthieu.

Posted: Thu Dec 28, 2006 6:55 am
by richdhan
Hi,

Even I have faced some weird issues with StringtoDecimal Conversion.

Just trim the string before doing the conversion.

HTH
--Rich