mauzer
04/17/2024, 4:35 PMaliaspooryorik
IN is for and you can use it with the list parameter of cfqueryparamaliaspooryorik
WHERE dbo.owner.OwnerID NOT IN ( <cfqueryparam value="#ownerList#" list="true">)mauzer
04/17/2024, 4:38 PMmauzer
04/17/2024, 4:43 PMmauzer
04/17/2024, 4:43 PMmauzer
04/17/2024, 4:44 PMJames Harris
04/17/2024, 4:45 PMJames Harris
04/17/2024, 4:45 PMmauzer
04/17/2024, 4:45 PMJames Harris
04/17/2024, 4:46 PMIN (SELECT [string] FROM dbo.iter_varcharlist_to_tbl(...))James Harris
04/17/2024, 4:47 PMAdam Cameron
getOwnerList variable. It's currently leaking out of the function.
Suspect you also wanna return something ๐James Harris
04/18/2024, 1:19 PMlocal.sqlArray = [
"id = 123456",
"id = 654321"
]
and then you would do...
QueryExecute(
"
SELECT *
FROM table
WHERE (:sqlConditions)
", {
sqlConditions = {cfsqltype="cf_sql_varchar", value=ArrayToList(local.sqlArray, " OR ")}
},
{datasource="..."}
);
or something like that?Myka Forrest
04/18/2024, 1:25 PMJames Harris
04/18/2024, 1:28 PMmauzer
04/18/2024, 1:32 PMaliaspooryorik
<cfset ownerList=ValueList(somequery.ownerID)> so you are getting the values from a database anyway? I guess the same database - so why not just do it all in one query and then you don't need to pass around 1,000s of valuesmauzer
04/18/2024, 2:05 PM