User defined function to check the NULL and 0.00 value in a Amount field

Hi Experts,

I have one scenario in which i have amount field in Data type.

I have to create one UDF which will do the following thing.

1. If the amount field is Null it should throw an exception in mapping.

2.If the amount field is 0.00 it should throw an exception in mapping.

3. For all other cases it should pass the amount value to the target.

Can anyone provide me the code For this UDF.

Thanks in advance.


chk this:

Execution type: single value


Source -Mapwithdefault(a)-UDF----Target

if(var1.equals("a") || var1.equals("0.00"))
throw new RuntimeException("Invalid Input");
return var1;

0 View this answer in context