Duncan, > > agreed. I tend not to use <cfloop query="foo">, but prefer <cfloop index > ="i" from="1" to="#queryname.recordcount#">. and if looping only 10 times, > or whatever less than the recordcount, then wrap it inside the check for > recordcount GT 0 > Is looping from 1 to recordcount more efficient than just looping the query from start to end without specifying the start/end rows??
I use the same code, but in CFSCRIPT for looping queries, but never using cfloop... So I'm curious if you find a performance difference with this. > incidentally, does <cfloop query="blah" startrow="1" endrow=" > #blah.recordcount#"> work (i.e. doesn't loop), or does it still loop at > least once? > As Tom says, it doesn't work in CFMX, but if you think about it if you have no records returned you're asking CF to do a loop from 1 to zero (a STEP of -1), so it should still try and do something, just that "something" isn't valid for a record set. Sridhar, > Because cfloop should take number of records first and then when it start > looping over it then it should take startrow attribute. > It shouldn't start the loop first from startrow attribute and then look for > records. > See above... You're asking CF to do a loop starting at row 1 and progressing to row zero.... Stephen -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
