LIKE Clause Formatting in Parameterized Query

Hello!   Short version of question: What is the correct syntax for using Mendix parameters with LIKE in a parameterized SQL query in Mendix?   Long version: I’m currently working on connecting to a database via JDBC to populate a drop down for an autocomplete field. The microflow the field calls to search the database executes a parametrized query to return a list of results to the dropdown field. The following query returns the correct record when the exact name is entered:       The parameter is the current string entered by the user to be used in the search. Of course, I don’t want the user to have to enter the exact name, so I add a LIKE operator to the query:   Which gives the following error when run:   The call clearly expects an argument, but I’m unsure how the usual parameter syntax (using ‘?’) interacts with the parameters defined in the screenshots. Presumably I’m missing something with the syntax, but I haven’t been able to find any examples or resources on this.    Thank you for your time!    
2 answers

I haven’t been able to find the issue with the syntax, but I’ve found a workaround by moving everything into the parameter like so:


The issue might be in the single quotes that you are using, maybe these need to be escaped with additional quote characters. The error message is not really pointing to the cause I suspect.

There are some posts on the forum on this specific issue, look at the comment at the bottom of this post for example: