The enum value should be in single quotes. If you're building the query string in the modeler you'll need to escape the single quotes inside the string with, get this, single quotes. So try something like:
'SELECT * FROM Example.Customer WHERE Status = ''Pending'''
Note that this only contains single quotes.
The executed OQL statement should then be:
SELECT * FROM Example.Customer WHERE Status = 'Pending'
Also if you only want to know how many there are, you may just as well retrieve from database using xpath and do a count. Mendix will automatically optimize this so it only retrieves a count, not a list of objects.
Hi Jhansi,
As Martin said,
I tried the same syntax in the OQL playground.
https://service.mendixcloud.com/p/OQL
By using sytax
SELECT FirstName FROM Sales.Customer WHERE CustomerType = 'FirstTimer'
and it's wokring there.
can you please check your enum attribute again.