Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
when I run the job it starts perfectly but in between it stops and gives null pointer exception
what should I do plz any one help me
thanks in advance
@cterenzi is correct. You either need to find the fault (find the null ) and prevent it from happening OR you need to put some logic in your expressions to mitigate for nulls.
For example (not using your expressions) if I want to check for a String value of "red" in a column and return a true if it is there AND prevent a null pointer exception I could use the following code in the expression to actively handle the situation where my String column is null
row1.myString!=null ? row1.myString.compareToIgnoreCase("red")==0 : false
The above is an in-line IF and says "If myString is not null AND if it contains 'red' then return true, otherwise return false"
in additional to all above answers and recommendations
You can balance, where to manage nulls?:
In Your case it could make tMap more clean and not overloaded
For manage nulls by database You can change tMSSQLInput query and add COALESCE function for columns used in tMap formulas
SELECT
COALESCE(col1,0) as col1,
COALESCE(col2,0) as col2
FROM table
WHERE
....
I prefer this way, because:
1) as I wrote it make tMap more readable
2) because SQL query it is plain text - I can use text edit with Search/Replace for change prepared query, and it faster than manually edit each tMap element
Note - it not help You in case divide by 0 - this is You need handle right in tMap if necessary
Thank you for your support
Thank you for your support,I will try it
thanks for your support..