Identify Null Values ...
Posted: Mon Nov 06, 2006 10:03 am
Hi,
I am doing a lookup on a table whose fields (all) have Nullable = No (DB2 Database). I am supposed to write these records to a reject file, if this lookup fails. I have 3 fields that are returned from the lookup table.
The following expression, evaluated at the output of the lookup, does not evaluate correctly -
If (
IsNull(lkp_link.C_CAR_TRK)
OR IsNull(lkp_link.C_FAM_LINE)
OR IsNull(lkp_link.I_CURR_SOLD)
)
Then 1 Else 0
(the above expression evaluates to 0)
Neither is this working -
If (
NullToValue(lkp_link.C_CAR_TRK,'X')='X'
OR NullToValue(lkp_link.C_FAM_LINE,'X')='X'
OR NullToValue(lkp_link.I_CURR_SOLD,'X')='X'
)
Then 1 Else 0
this evaluates to 0 as well.
Need help on how to determine whether the lookup has failed or succeeded.
Kindly excuse if a similar Q has been posted before.
Rgds
Niraj
I am doing a lookup on a table whose fields (all) have Nullable = No (DB2 Database). I am supposed to write these records to a reject file, if this lookup fails. I have 3 fields that are returned from the lookup table.
The following expression, evaluated at the output of the lookup, does not evaluate correctly -
If (
IsNull(lkp_link.C_CAR_TRK)
OR IsNull(lkp_link.C_FAM_LINE)
OR IsNull(lkp_link.I_CURR_SOLD)
)
Then 1 Else 0
(the above expression evaluates to 0)
Neither is this working -
If (
NullToValue(lkp_link.C_CAR_TRK,'X')='X'
OR NullToValue(lkp_link.C_FAM_LINE,'X')='X'
OR NullToValue(lkp_link.I_CURR_SOLD,'X')='X'
)
Then 1 Else 0
this evaluates to 0 as well.
Need help on how to determine whether the lookup has failed or succeeded.
Kindly excuse if a similar Q has been posted before.
Rgds
Niraj