Datasets Source OQL Query cannot parse the REPALCE function call?

0
Hi all, I have created a Dataset in Mendix 10.18.3 with the following OQL code: SELECT REPLACE(Code, ' ', ',') AS ST FROM BudgetControl.Request   Code is a String attribute of the entity BudgetControl.Request. The OQL query looks OK to me, but the IDE keeps reporting this error: missing RPAREN at ',' . Could someone give me a hint? Thanks a lot, Tuan
asked
2 answers
1

Dear Tuan Le,

 

I see you are using 10.18.3 but keyword like replace is introduced starting from version 11. You either upgrade to 11 and above or use microflow/java to replace.

 

 

Hope my answer helps. Reach me out for any queries. 

answered
0

You are getting this error because REPLACE is not supported in Mendix OQL as it is not part of the available OQL function set in your current version. As an alternative, you can create a simple Java Action that performs the string replacement and call it in a microflow before passing the value into the dataset or consuming it elsewhere. The Java action would simply take an input string and use the standard Java replace() or replaceAll() method to replace spaces with commas, then return the processed string. 

answered