3
Views
5
Comments
TableX.TypeId = NullIdentifier() VS TableX.TypeId = IntegerToEntityRefInteger(0)
Question
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
2018-05-16 11-16-36
João Heleno
 
MVP
Hi Pedro,

is that an external table, exposed in an extension?
UserImage.jpg
Pedro Menezes
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.
2018-05-16 11-16-36
João Heleno
 
MVP
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?
UserImage.jpg
Pedro Menezes
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 ...
2018-05-16 11-16-36
João Heleno
 
MVP
Yeah, I was about to suggest your line had zero instead of null.
Glad you overcome the situation.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.