Sorry about resurrecting an old issue. I found what seems to be a similar
bug. Even if I save those to local variables at the top of the cfloop, if I
have a lot of processing in the middle I sometimes get that even outside the
inner cfloop/cfoutput.
In my case, query2 and query3 are set inside the loop over query1, and then
do processing on 2 and 3 to generate the details to dump out for the record
of query1.
queryOne has 111 rows, and let's say colA's value is the same rownumber (1
to 111)
<cfloop query="variables.queryOne">
<cfset Variables.colA = variables.queryOne.colA>
<cfset Variables.colB = variables.queryOne.colB>
<cfset Variables.queryTwo = qfactory.getq2(Variables.colA)>
<cfset Variables.queryThree = qfactory.getq3(Variables.colA)>
<br />
<cfoutput><p>(#variables.queryOne.currentRow#)
ColA=#Variables.colA#</p></cfoutput>
<p>Assume there's Lots of Processing here on query2 and 3, none of which
touches queryOne.....</p>
<p>(Dump the generated results for this queryOne record here)</p>
</cfloop>
Results:
(1) ColA= 1
(2) ColA= 2
(3) ColA= 3
(4) ColA= 4
....
(45) ColA= 45
(46) ColA= 1
(47) ColA= 1
(48) ColA= 1
....
....
(111) ColA = 1
If I remove all the extra processing in the middle, get correct value for
colA = 46 ... colA = 111
Workaround is at top of outer loop on queryOne, get query variables by the
currentRow. Even though it's at the top of the cfloop on that query, outside
any inner query loops.
<cfset Variables.colA = variables.queryOne.colA[
variables.queryOne.currentRow]>
<cfset Variables.colB = variables.queryOne.colB[
variables.queryOne.currentRow]>
- David
On 3/3/06, Ryan Guill <[EMAIL PROTECTED]> wrote:
>
> But thats not the case. The current row is correct, even in the inner
> loop, but the value is not.
>
> On 3/3/06, Claude Schneegans <[EMAIL PROTECTED]> wrote:
> > I think this issue has been discussed a few days before.
> > It is a bug in CF (not in blue Dragon).
> > The current row of a first level loop is alway on when seen from an
> > inner loop.
> > The workaround is to store column values in variables at the first
> level.
> >
> > --
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:243419
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54