Use WHERE IN clause in OQL

0
Hi. I am having problems using the WHERE IN clause.     As the image above shows, the query is correct. But I want a dynamic value, there can be 1 or 2 or more "(Code)" values, not fixed, so I tried writing the circled sentence into a string like the image below, but oql mendix doesn't support it. Or maybe I'm writing it wrong. Who can help me? Thank you very much.  
asked
1 answers
2

If you want to put variables into a string, you'll have to make sure it's not part of the string itself. What you're passing to the query right now is a literal '$Variable_Test_1' which is never replaced by the value.

Instead, you can stop your literal string value.

 

So imagine you're trying to do SELECT * FROM $TableName;

then your expression would look like this:

 

'SELECT * FROM ' + $TableName + ';'

answered