Page 1 of 1

StringToDecimal function - producing warnings

Posted: Sun Jul 01, 2007 4:55 pm
by Titto
Hi,

I am getting following error in one my job, the same job ran fine in other DS environment with out any error with same data - what could be the reason.
Operating system AIX 5.0 in both DS environments.

Code: Select all

Conversion error calling conversion routine decimal_from_string data may have been lost
Any info/help is appreciated!

~t

Posted: Sun Jul 01, 2007 5:57 pm
by ArndW
What is the string contents and what is the decimal column definition. Have you checked the other environment to see if you have a message handler set for that that job?

Posted: Thu Jul 05, 2007 4:39 pm
by Titto
Hi Arndw,

verified other environments, there are not message handlers for those warnings.

basically in those jobs programmer converting a Varchar field to a Number value using StringToDecimal function but we changed that process to use AsInteger function as we know that the source data will have numeric values.

Thanks

Posted: Thu Jul 05, 2007 6:06 pm
by ray.wurlod
Check the data types, in particular the string length (or max length) and the decimal precision and scale. Are these the same in both environments?

Posted: Fri Jul 06, 2007 4:06 am
by Umberto
Try "StringToDecimal(Trim(InputField))".......

input check

Posted: Fri Jul 06, 2007 5:56 am
by thuan
You also need to check whether the input is not blank or not is null.
The warning is saying that you are applying the function on non numeric varchar.

Posted: Fri Jul 06, 2007 9:49 am
by ray.wurlod
No it isn't. It's saying that there are too many digits in the value.