Is there a way to convert a query result set (one field in it) into a 1-d array?
I need a list for criteria in another query ... (WHERE value IN '#list#')]
Actually, the query results can get pretty big, and I thought that maybe since you can get at query records like this...
queryname[4]
....
that there would be some way to do something like this...
<cfset ListVariable=ArrayToList(one-field-yielding-query)>
but all I got was errors, and looping would defeat the purpose in my case...
right now I'm doing the second query like this...
DELETE from TABLENAME
where 0=1
<cfloop query="QUERYNAME">
OR field='#field#'
</cfloop>
which works fine ...
but I know that MySql,which is what I'm using, can process IN operations much faster..hence my want (not neccesarily need) for a list.
Your idea is clever but I suspect the reason it's not working is that CF doesn't treat a query result internally as an array. The syntax is the same but I'd bet the internal data structures are quite different.
Is there any reason you wouldnt' want to do something like this:
delete from TABLENAME where field IN (select fieldName from Table2 where ..)
I've never tried a delete this way but I think this is what you're trying to accomplish.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.