How to use enumeration in OQL where clause.

I am trying to filter out values based on the value on Enumeration, I am unable to figure the syntax for it in OQL. The documentation doesn’t have any info.
2 answers

Enumerations are stored as strings in the database. The values of the enumeration are the values that are stored, so I think you should write your OQL treating the enum like a string.

So if your attribute called Priority has the possible values and captions like this:

1_Low            Low

2_Medium    Medium

3_High           High

Then your query would be like:

WHERE Priority=’1_Low’


0 gave me a good lead

function getCaption() extract enumeration value usable in OQL statement

    ContentNo as entityId,
    Title as Title,
    ShortDescription as Description,
    ContentType as Origin,
    NoLikes as NoLikes,
    NoViews as NoViews,
    NoRate as NoRates
from General.Content
where' + 
'    (Title like ' + '''%' + 
+ '%''' +
'    or ShortDescription like ' + '''%' + 
+ '%''' +
'    ) and (ContentType = ' +  '''' + 
+ ''')'