Returns the current row number

queryCurrentRow(query) → returns numeric

Member Function Syntax


This function requires Lucee.  Not supported on Adobe ColdFusion, etc.

queryCurrentRow Argument Reference

query query

Examples sample code invoking the queryCurrentRow function

Here we've example to get the currentRow number.

<cfset myQuery = queryNew("id,name","integer,varchar",[[1,"Rajesh"],[2,"Anil"]])>
<cfloop query="myQuery">
	<cfif name Eq "Anil">

Expected Result: 2

Here we've example to get the currentRow number from query using script syntax.

var myQuery = queryNew("id,title","integer,varchar",[[1,"Charlottes Web"],[3,"The Outsiders"],[4,"Mieko and the Fifth Treasure"]]);
cfloop(query = "myQuery"){
	if (title Eq "Mieko and the Fifth Treasure"){

Expected Result: 3

Fork me on GitHub