Replies: 2 comments 4 replies
-
I do not know the answer but I think what you want to search for and learn about are:
I think you need a List where the first element is also a List which contains your values.
^ This code is an idea. It is probably not exactly the right code!! ^ Search here on github or https://forums.mirthproject.io/ for more complete examples |
Beta Was this translation helpful? Give feedback.
3 replies
-
The IN clause expects a list or array of values, but you're passing a single string containing comma-separated values.
or something like this:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How to use parameterization and IN statements within Mirth.
I have the following code:
`
var idList = "'2', '3'";
var query = "SELECT * FROM TEST WHERE tableID IN (?)";
var param = new Lists.list().append(idList);
var dbConn = createDBConn('testdb');
var results = dbConn.executeCachedQuery(query, param)
`
I get 0 results. but if I run the SELECT * FROM TEST WHERE tableID IN ('2', '3') in SQL i get 2 results.
I have also tried using idList = new Lists.list().append('2').append('3') and many other combinations with no luck. If I remove the ? and hard code the values I get the expected 2 results. I am sure I am totally missing something just not sure what that is.
Beta Was this translation helpful? Give feedback.
All reactions