Parameter
Last updated on
Apr 27, 2021
Description
Calculates the number of rows in a query object.
Returns
The number of rows in a query.
Category
Syntax
QueryRecordCount(Object query)
Member functions
queryObject.RecordCount()
See also
History
ColdFusion (2018 release) Update 5: Added the function and the member function len().
Parameters
|
Required/Optional |
Description |
---|---|---|
query |
Required |
The query object whose rows are to be counted. |
Example
<cfscript> myQuery1=queryNew("empid,depid,name", "integer,integer,varchar",[ [10, 101, "John"], [20, 120, "James"], [30, 205, "Peter"] ]); writeoutput(QueryRecordCount(myQuery1)) // Returns 3 writeoutput(myquery1.getRecordCount()) // Returns 3 writeoutput(myquery1.len()) // Returns 3 writeoutput(myquery1.RecordCount) // Returns 3 </cfscript>