User Guide Cancel

QueryGetResult

 

Description

This function retrieves metadata about a query object. The funtion returns its metadata, such as, executiontime, cache status, and recordcount key.

Returns

Struct of the query metadata.

Category

History

ColdFusion (2018 release): Introduced named parameters.

New in Adobe ColdFusion (2016 release) Update 3.

See also

Syntax

QueryGetResult(query);
QueryGetResult(query);
QueryGetResult(query);

Parameters

Parameter

Required/Optional

Description

query

Required

The query whose metadata is to be returned.

Example 1

<cfscript>
myQuery = queryNew("id,name,amount","Integer,Varchar,Integer",
[
{id=1,name="One",amount=15},
{id=2,name="Two",amount=18},
{id=3,name="Three",amount=32}
]);
newQuery=QueryExecute("SELECT * FROM myQuery",[],{dbtype="query"})
myResult=QueryGetResult(newQuery)
writeDump(myResult)
</cfscript>
<cfscript> myQuery = queryNew("id,name,amount","Integer,Varchar,Integer", [ {id=1,name="One",amount=15}, {id=2,name="Two",amount=18}, {id=3,name="Three",amount=32} ]); newQuery=QueryExecute("SELECT * FROM myQuery",[],{dbtype="query"}) myResult=QueryGetResult(newQuery) writeDump(myResult) </cfscript>
<cfscript>
    myQuery = queryNew("id,name,amount","Integer,Varchar,Integer", 
                [ 
                        {id=1,name="One",amount=15}, 
                        {id=2,name="Two",amount=18}, 
                        {id=3,name="Three",amount=32} 
                ]); 
    newQuery=QueryExecute("SELECT * FROM myQuery",[],{dbtype="query"})
    myResult=QueryGetResult(newQuery)
    writeDump(myResult)
</cfscript>

Output

output

Example 2

<cfscript>
myQuery=QueryExecute("SELECT * FROM EMPLOYEES",[],{datasource="cfdocexamples"});
myResult=QueryGetResult(myQuery);
WriteDump(myResult);
</cfscript>
<cfscript> myQuery=QueryExecute("SELECT * FROM EMPLOYEES",[],{datasource="cfdocexamples"}); myResult=QueryGetResult(myQuery); WriteDump(myResult); </cfscript>
<cfscript>
       myQuery=QueryExecute("SELECT * FROM EMPLOYEES",[],{datasource="cfdocexamples"});
       myResult=QueryGetResult(myQuery);
       WriteDump(myResult);
</cfscript>

Output

Using member function

<cfscript>
myQuery=QueryExecute("SELECT * FROM EMPLOYEES",[],{datasource="cfdocexamples"});
myResult=myQuery.GetResult();
WriteDump(myResult);
</cfscript>
<cfscript> myQuery=QueryExecute("SELECT * FROM EMPLOYEES",[],{datasource="cfdocexamples"}); myResult=myQuery.GetResult(); WriteDump(myResult); </cfscript>
<cfscript>
       myQuery=QueryExecute("SELECT * FROM EMPLOYEES",[],{datasource="cfdocexamples"});
       myResult=myQuery.GetResult();
       WriteDump(myResult);
</cfscript>

OUTPUT

Get help faster and easier

New user?