Page 1 of 1

problem in null handling

Posted: Mon Dec 31, 2007 2:49 am
by arnie_nits
Hi

I am having a problem with null handling. My code in tranformer derivation is-
If In_Tfm_EmpId_Customer.TRAN_TYPE='EMPSALE' AND In_Tfm_EmpId_Customer.CUSTOMER<>' ' Then NullToValue(In_Tfm_EmpId_Customer.ASSOC_ID,' ') Else NullToValue(In_Tfm_EmpId_Customer.EMP_ID,' ')

But still I am getting null values.

Please help

Regards
Arnie

Posted: Mon Dec 31, 2007 3:00 am
by ray.wurlod
You need some NullToValue() - or other null handling function - in the test expression portion of the If expression.

Posted: Mon Dec 31, 2007 9:44 am
by dspxlearn
The Null values are a bit tricky here.

Seems, for these 2 fields you are getting Null values from the source.
And you are not making Null checks for In_Tfm_EmpId_Customer.TRAN_TYPE, In_Tfm_EmpId_Customer.CUSTOMER.


The code would be this way:

Code: Select all

If NullToEmpty(In_Tfm_EmpId_Customer.TRAN_TYPE) ='EMPSALE' AND NullToEmpty(In_Tfm_EmpId_Customer.CUSTOMER) <> ''
Then NullToValue(In_Tfm_EmpId_Customer.ASSOC_ID,' ')
Else NullToValue(In_Tfm_EmpId_Customer.EMP_ID,' ')