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.

Argument Reference for the queryGetResult function

query

Required: Yes
The query whose metadata is to be returned.

Examples sample code invoking the queryGetResult function


Retrieves query metadata using queryGetResult

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

Retrieves query metadata using getResult member 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 = myQuery.getResult();
writeDump(myResult);

Fork me on GitHub