cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ERQL queries with boolean MetaAttributes

lmazurie
Honored Contributor

Dear all,

 

An apparent trivial question but with ERQL I have got a lot of problem for boolean values queries.


What is the official syntax ?  

 

Thanks a lot.

 

Lionel Mazurié
3 Replies

alros
Super Contributor

Interestingly, comparison [BooleanAttribute] = 0 works as expected, but [BooleanAttribute] = 1 doesn't. The following query will give all Applications with [BooleanAttribute] set to true:

 

Select [Application] Where Not [BooleanAttribute] = 0

 

This also works for Relationship attibutes:

 

Select [Application] Where Not [Association].[BooleanAttribute] = 0 And [Association] Not Null

lmazurie
Honored Contributor

Hi Jérôme

 

Null and Not null are just to query if the boolean is evaluated to noting or {0,1} but I can't separate 0 and 1.

I am forced to change to Yes/no ...

 

Thanks

Lionel Mazurié

jhorber
MEGA
MEGA

Hello Lionel

 

There is nothing explicit in the documentation

Implicitely

Select MyMetaClass where MyBooleanMetaAttribute Is Null

Select MyMetaClass where MyBooleanMetaAttribute Is Not Null

 

Boolean MetaAttributes are very rarely used in MEGA/HOPEX.

It is recommended to use string MetaAttributed wirth enumeration (ex: Yes/No)

Jerome