Page 1 of 1

Varchar to decimal -

Posted: Sat Mar 26, 2005 6:54 pm
by dsxuserrio
I am reading several fields as varchar and in the first transformer I just choose the data type as decimal 15 and everything worked fine as expected. The max I had to do was in the transformer use

Code: Select all

IF IsNull(filed) Then 0 Else filed
But for only one field I could not get away with this. I had to use handle_null in a modify stage.
Otherwise when I validate I get an error message something like
Wen converting form string to decimal , no null handling etc....


Any ideas??

Posted: Sun Mar 27, 2005 3:12 am
by roy
Hi,
I think if you'll look at documented conversions you'll find a potential null being the result,
If there is any chance for a null that is enough to "force" you handle nulls.
I guess it's just not that obvious to us it could happen or to the engine that it can't.

Posted: Sun Mar 27, 2005 12:42 pm
by T42

Code: Select all

If IsNull(input.value) Then 0.00 Else StringToDecimal(input.value)
In DataStage's transformer, Integer and Characters are interchangeable.

Edit:
will any official course provide the DS knowladge I seek or is it only an Ascential employee priviladge?
Depends on what you want to know! :lol: