Calls the provided function for each row of the provided query and removes the row from query if the function returns false
QueryFilter(Object query, UDFMethod func)
Parameter | Description |
query | (Required) Query to be iterated over. |
func | (Required) Function to be called with each row of the query. Should return a boolean value. |
<cfscript> qoptions = {result="myresult", datasource="cfbookclub", fetchclientinfo="yes"}; sampleQuery = QueryExecute("select * from books order by bookid", [] ,qoptions); function filterQuery(any Obj){ return (Obj.ISSPOTLIGHT == "Y" ? true : false); } WriteDump(QueryFilter(sampleQuery, filterQuery)); </cfscript>