Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Franz3
Contributor III
Contributor III

How do i get a null int/Integer

Hello,
I have a trouble in a tMap when i am trying to map with a left join and compare after the value of the key to update or insert.
the problem is the key is a number, and Talend cast it in int rather than Integer so it's value can't be null.
How can i cast it in Integer knowing that's it's just the output of DBinputcomponent, i don t see any options.

Labels (2)
7 Replies
Anonymous
Not applicable

Schemas allow you to specify if a column is nullable. This usually determines if it is an int or an Integer. You need to make it nullable. If it is, then there's something else not right.
Franz3
Contributor III
Contributor III
Author

It's not, and if i change it my problem is solved.
But the trouble i have here is that the column isn't nullable in my DB. I have to specify it just for the left join case i don't get the logic behind this, for me it's a bug.
The question is pretty simple : why is my variable equal to 0 even if it doesn't exist as a left join not matching value.
Anonymous
Not applicable

Your original question was how to use Integer rather than int. Checking nullable is the answer.
I'm do not know what the relevance of the column not being nullable in your DB, is. You need to explain the problem more.
There is no bug, here.
Franz3
Contributor III
Contributor III
Author

My column is not not nullable because it's the key.

I have a tmap, 1 main stream M and 1 lookup Stream L.
I do a left join on the key because both streams have the same structure.
What i want is to check in my output if the the row is joined or not.
So i basically test the value of the lookup Stream key which is an int as a not nullable primary key (which seems pretty normal)
When i test the value it return 0 in the case of a non matching row. As a possible value for my key i can't test 0, plus i dont know why Talend translate the void in 0 which is a correct value.
gorotman
Creator II
Creator II

Hi,
is your column int or Integer?
With int, null is not allowed, so TOS return 0 if lookup is null.
I don't know if =null works with Integer....
Franz3
Contributor III
Contributor III
Author

if=null works with integer and not with int.
But if i want an integer i have to cross the nullable case which is kind of problematic as a primary key value, and it will change my value in-built
gorotman
Creator II
Creator II

Fwandz wrote:
if=null works with integer and not with int.
But if i want an integer i have to cross the nullable case which is kind of problematic as a primary key value, and it will change my value in-built

Ok, I understand and I share your question (I'had same problem, solved beacuse I can test a string column also available).
It sholud be useful if TOS has a lookup flag to test (it is available in others ETL program, for example).

A workaround may be to insert a tMap and convert int to Integer, so you can use repository metadata and also have nullable column for lookup.

Bye