Description

This function returns the metadata of a query.

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

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(newQuery)
</cfscript>

Output

QueryGetResult1

Example 2

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

Output

QueryGetResult

Using member function

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

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy