This function takes a query, removes all the rows, then returns a query object with no records
queryClear(query)
→ returns query
query.clear()
Description of the code example
heroes = queryNew("id,Name",
"integer,varchar",
[
{"id":1,"Name":"Bruce Banner"},
{"id":2,"Name":"Tony Stark"},
{"id":3,"Name":"Bobby Drake"},
{"id":4,"Name":"Jean Grey"}
]
);
writeOutput("Query with records<br />");
writeDump(heroes);
writeOutput("The same query, but cleared<br />");
writeDump(heroes.clear());
Expected Result: A query with 4 heroes, then a query with none
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.