Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
First of all, I know the difference between int and Integer, hence why I'm using the Integer type in my tmap by click the "nullable" checkbox.
I have a condition which either :
- Get an Integer from a lookup table based on a specific condition
- If the condition isn't respected but the value is still in the lookup table I want it to be null (not 0)
- Else I'm parsing my existing value using Integer.parseInt(....)
But I'm getting java.lang.NumberFormatException: null because apparently I can't put null in my Integer column (even tho I should be able to do so)
Is there something else I should be doing ?
I found a solution since it wasn't working.
It looks like I could not put in the same "if - else" condition a null result and an Integer.parseInt(...)
What I ended up doing was that using the String format in the Var section of the tMap and in the output table I did :
Var.code_societe!=null?
Integer.parseInt(Var.code_societe)
:
null
I'm not totally clear on what you are trying to do but maybe in the input data you are conditional joining too, check that the schema editor has that column as allowed to be Nullable. If not you will get a 0 as the schema doesn't allow NULLs. I got caught out by that.
Can you show the expression you are using on tMap? If you just want to assign a null value to a Integer column, to do:
Regards
Shicong
Everything is checked for Nullable, but I found a getaround solution that works
I found a solution since it wasn't working.
It looks like I could not put in the same "if - else" condition a null result and an Integer.parseInt(...)
What I ended up doing was that using the String format in the Var section of the tMap and in the output table I did :
Var.code_societe!=null?
Integer.parseInt(Var.code_societe)
:
null