The Params section of ormExecuteQuery takes a struct of parameters (if
you are using named parameters). You are passing in one parameter, a
list, not an array of individual parameters.
Consider, for example, if you also wanted to specify another
parameter, like whether the foo is new or not. You'd do:
myIDs = "1,2,3,4,5,6,7,8,9,10";
isNew = true;
hql = "FROM foo WHERE bar IN (:idList) AND isNew = (:isNew)";
foos = ormExecuteQuery(hql, {idList = myIDs, isNew = isNew});
If you look at it that way, you see you are passing in a string of ids
that would result in the SQL:
FROM foo WHERE bar IN ('1,2,3,4,5,6,7,8,9,10') AND isNew = false
Hope that helps (and is correct as I didn't trying it)
Cheers,
Judah
Use an array, instead of list:result = ORMExecuteQuery("
FROM model
WHERE id in (:list)"
, {list = [1,2]}
);
Awesome - thanks!
- sent by a little green robot powered device