It is still this way.

-----Original Message-----
From: Jim McAtee [mailto:[EMAIL PROTECTED]]
Sent: maandag 21 januari 2002 3:25
To: CF-Talk
Subject: Re: Nested Loops Over Queries


No, more like this:

<cfquery name="a" datasource="#dsn#">
SELECT * FROM table1
WHERE ...
</cfquery>

<cfloop query="a">

  <cfquery name="b" datsource="#dsn#">
  SELECT * FROM table2
  WHERE ...
  </cfquery>

  <cfloop query="b">
    <cfoutput>
    #a.this# #a.that# #b.currentrow# #b.whatever#<br>
    </cfoutput>
  </cfloop>

</cfloop>

I seem to recall that in CF4 and earlier, no matter what you did within
the
inner loop over query "b", that CF would always address row 1 of query
"a",
and that if you needed to reference the actual current row of query "a",
you
needed to store the data in temporary variables and reference those
within
the inner loop.

Another workaround was to use subscripted variables to reference items
from
the outer query when inside an inner loop, as in:

<cfset i = a.currentrow>
<cfloop query="b">
  <cfoutput>
  #a.this[i]# #a.that[i]# #b.currentrow# #b.whatever#<br>
  </cfoutput>
</cfloop>


Jim


----- Original Message -----
From: "Steve Oliver" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Sunday, January 20, 2002 7:07 PM
Subject: RE: Nested Loops Over Queries


> You mean if you do something like this?
>
>
> <cfloop query="qryName">
>
> <cfloop from="1" to="10" index="I">
> <cfoutput>#qryName.value#</cfoutput>
> </cfloop>
>
> </cfloop>
>
>
> Works fine for me (on CF5)
> Each loop of the outer loop give the inner loop value the next row
value
> in the recordset.
>
> ______________________
> steve oliver
> cresco technologies, inc.
> http://www.crescotech.com
>
>
> -----Original Message-----
> From: Jim McAtee [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, January 20, 2002 8:58 PM
> To: CF-Talk
> Subject: Nested Loops Over Queries
>
>
> Does CF5 exhibit the same behavior as older versions in regard to
nested
> query loops?  Namely, that from within an inner loop, CF doesn't know
> which row it was processing in an outer loop (or, equivalently, any
> references to an outer query all refer to the first row of the query)?
>
> Jim

______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
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

Reply via email to