Returns the current row number

queryCurrentRow(query) → returns numeric

Member Function Syntax


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

Argument Reference

query query

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

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub