queryGetResult

Returns the metadata of a query.

queryGetResult(query) → returns struct

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

queryGetResult 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);

Fork me on GitHub