Type Conversion Error........

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Type Conversion Error........

Post by pavans »

Hi

I am getting a following error.

Un-handled conversion error on field "FOB_TYPE_C " from source type "string[40]" to destination type "decimal[10,0]":
source value="WS "; the result is non-nullable and there is no handle_null to specify a default value.

The datatype for FOB_TYPE_C is Char(40) in source table (oracle).
In Target it goes to PO_TYPE_C Number (10).

I tried using StringToDecimal(Trim(FOB_TYPE_C)) but didnt work.
Let me know your inputs.

Thanks
Thanks,
Pavan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Curious... how do you propose to convert string values like your "WS" into a decimal?
-craig

"You can never have too many knives" -- Logan Nine Fingers
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Post by pavans »

chulett wrote:Curious... how do you propose to convert string values like your "WS" into a decimal? ...
---------------------------
Even i was surprised to see that.
Som else has done the coding and job aborted due to this and i was looking into it for the first time. I didnt realize this.

----------------------------------------------------------


Do we have a way to handle this.
Let me know your inputs.
Thanks,
Pavan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Type Conversion Error........

Post by chulett »

As noted in your error message:
pavans wrote:the result is non-nullable and there is no handle_null to specify a default value.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Re: Type Conversion Error........

Post by pavans »

chulett wrote:As noted in your error message:
pavans wrote:the result is non-nullable and there is no handle_null to specify a default value.
You mean:

StringToDecimal(FOB_TYPE_C);
i tried but it didnt work.
Am i missing anything here.
Thanks,
Pavan
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes, you are missing a specification of what to do when the data include a NULL.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
John Smith
Charter Member
Charter Member
Posts: 193
Joined: Tue Sep 05, 2006 8:01 pm
Location: Australia

Post by John Smith »

You have a data quality issue here, the source data contains row(s) with the value "WS " which you are attempting to convert to a decimal. either you provide rules to deal with this e.g what is the equivalent of WS in decimal ? or you filter out these records.
Post Reply