replace() within OQL statement

3
Hi All. I have a set of OQL statements that use the string replace() in the select statement eg  Select replace(MyData, ‘x’, ‘’) as MyData from MyTable. wherein x is removed (replaced by an empty value) within the result. This is using the App store OQL module and the exportascsv option This currently works in 8.17 but is breaking in an upgrade to 9.10. The function is not mentioned as supported in the docs. Does anyone have any ideas how to remedy or is this a Mendix request to resolve?  
asked
2 answers
0

Hi Tim,

I think you can use Case statements

Ref:  https://docs.mendix.com/refguide/oql-case-expression/

Hope it Helps!!

answered
0

I am surprised that this is not a function more widely used within the OQL.

However, the replace() was just luck that it worked in Mx8 and unfortunately does not look like it will be fixed by Mendix.

So, for anyone who needs to do any type of replace() call in OQL, unless it is a reasonably simple replace that you are doing wherein you can use a Case statement and perhaps a like function which when true can return a value, then you may need to think in terms of changing the process to carry out the replace() in a microflow. 

It is not possible to carry out a select replace() of a character in a string or a phrase within a string within the OQL statement as there is no availability of a start position or end position or concatenation etc within the statement.

If someone knows different, it would be good to hear it.

 

answered