My gut feeling says that you are only using OQL to get a count of a specific set of data. And you use OQL because you can.
But when you really want to use Mendix the best way; only use OQL if the default used query language XPath isn’t sufficient.
In your example I don’t see any need for a OQL query.
Add an activity
→ Type: Retrieve
→ From database
→ select the required Entity
→ Add XPath constraint if needed to define the subset of that entity
Add a second activity
→ Type: Aggregate
→ Select the output list of preceding activity
These two activities, although modeled separately will be executed as a direct Count Select query. Returning only the Count as primitive Integer value.
Benefit; no need to hassle with OQL syntaxes and fellow Mendix developers also understands what you are doing.
Lose the braces around “VM” and replace single-quotes by doublequotes. Also, you are adding this OQL to the ‘Execute OQL Statement (count Rows)’ so you can (should) lose the count (*) too. Also the parameter won’t get accepted. Insert the modulename.tablename surrounded by doublequotes.
Btw. you can test OQL-statements by dragging the snippet OQL into some page or by going to https://mydemoversion8-sandbox.mxapps.io/p/OQL
updated query still errors out , i am also not able to find a good document on oql syntaxes on the website..
What are other ways of finding count of an attribute ( which is string)
i tried using the aggregate but that does not list the attribute for count.