if you do this:
<CFLOOP query="myQuery">
<CFIF myQuery.currentRow is 3>
output my query stuff
</CFIF>
</CFLOOP>
That should work for you. Also in SQL Server you can use a cursor to what
you are talking about, but they are really dangerous and would cause a major
overhead increase. Also the array notation would be like myQuery.myVar[3].
Tim Heald
ACP/CCFD :)
Application Development
www.schoollink.net
> -----Original Message-----
> From: Shawn Grover [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 25, 2002 12:11 PM
> To: CF-Talk
> Subject: Setting Current row for query object???
>
>
> If I have a query object with 4 records, is there a way to set the pointer
> to the third row, and use values from that record?
>
> I've tried this:
>
> <cfloop query="MyQuery">
> <cfif MyQuery.nRowNumber eq 3>
> <cfbreak>
> </cfif>
> </cfloop>
> <cfoutput>MyQuery.FieldName: #MyQuery.FieldName#</cfoutput>
>
> however, the output is for the first row. putting alerts in the if block,
> and after the loop show that the record is being found, but then
> the pointer
> resets to the first row.
>
> I know I can move my output into the CFIF block, but was hoping to avoid
> that (lots of code to move around in multiple places - and
> toooooo many uses
> of the query objects to use the bracket notation i.e.
> MyQuery[3].FieldName.
> it would take hours to change them all even with search and replace).
>
> Can the native query variable CurrentRow be used to SET the current row?
> (instead of just reporting the current row).
>
> Thanks in advance.
>
> Shawn Grover
>
>
>
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists