Page 1 of 1

Paramertized SQL for IN clause

Posted: Mon Mar 09, 2015 10:22 am
by atarrant
I'm gathering a list of IDs in my Project which I'm currently forming into a comma separated list "listOfIDs" and then at the end I'm looking to pull records from the database based on the list.

So listOfIDs looks like this: 56347,75647,23467

select a,b from tablex where id in (?)
parameter 1: ${listOfIDs}

Normally in Java I would pass this list in as an array and I see array as an available datatype in the parameter but am not sure how to form the data into an array. Not sure the best route on this.