queryGetResult

Returns the metadata of a query.

queryGetResult(query) → returns struct

This function requires Adobe ColdFusion 2016.3 and up.  Not supported on Lucee, etc.

Argument Reference

query query
Required

The query whose metadata is to be returned.

Examples
Sample code invoking the queryGetResult function

fruit = queryNew("id,name",  "integer,varchar", [ {"id":1,"name":"apple"}, {"id":2,"name":"banana"}, {"id":3,"name":"orange"}, {"id":4,"name":"peach"} ]);
myQuery = queryExecute( "select * from fruit where id < 4",{},{dbtype="query"});
myResult = queryGetResult(myQuery);
writeDump(myResult);

fruit = queryNew("id,name",  "integer,varchar", [ {"id":1,"name":"apple"}, {"id":2,"name":"banana"}, {"id":3,"name":"orange"}, {"id":4,"name":"peach"} ]);
myQuery = queryExecute( "select * from fruit where id < 4",{},{dbtype="query"});
myResult = myQuery.getResult();
writeDump(myResult);

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub