TableX.TypeId = NullIdentifier() VS TableX.TypeId = IntegerToEntityRefInteger(0)

TableX.TypeId = NullIdentifier() VS TableX.TypeId = IntegerToEntityRefInteger(0)

Hello I have a query to fetch results and one of the conditions is "TableX.TypeId = NullIdentifier()" but it doesn't get any results from the query.

But if I change to "TableX.TypeId = IntegerToEntityRefInteger(0)" it fetchs the result I want. Can anyone explain this difference in behaviour? Thank you
Hi Pedro,

is that an external table, exposed in an extension?
Yes it is a table from another eSpace.

Don't quite understand what is "exposed in an extension".

But yes it is external table (the Table X), from other eSpace.
I was asking if your table was from an external schema and not from another espace... but nevermind.

Back to your problem...that's weird. From what type is the attribute TypeId? It's probably numeric right?
Hi João again thank you for your help.

I guess that someone introduced zeros directly in the database table, so Outsystems gets confused. I didn't check but Outsystems probably stores in the database as NULL (the null identifier) but when it shows on service Studio it shows as zero and works as if it was a zero.

I think that is probably the problem. Anyway now I use the two conditions in the query and it is solved, but if you can confirm that the problem is the one I stated would be nice just to clarify this situation. Thank you ...
Yeah, I was about to suggest your line had zero instead of null.
Glad you overcome the situation.