Populating an IN statement with Query execute


#1

Any thought on how to use the IN Statment populated form an array in the query params?


Query execute argument horror
#2

ArrayToList?


#3

That does not work. Even if you put a ‘Comma Separated list into a variable’ and put that variables into the in that will not work ether. The problem does not seem to be unique to Lucee. See this tread regard parameterized query’s in C#

http://stackoverflow.com/questions/650455/c-sharp-parameterized-query-mysql-with-in-clause.

I’d still like to have this function in lucee


#4

Why are you writing your query strings, arguments, parameters directly into the queryExecute function?

this.config = {'datasource': '[DB_NAME]};
this.args = {'param_one': [VAL_ONE], 'param_two': [VAL_TWO]};
this.sql = 'SELECT * FROM -TABLE- WHERE param = :param_one'; 
queryExecute(this.sql, this.args, this.config)

#5

use a QueryParam with list=true


#6

Does not work in QueryExecute


#7

Then that might be a bug that should be addressed.

Care to open a ticket in the JIRA?
https://luceeserver.atlassian.net/secure/Dashboard.jspa