The only scope of higher-precedence than field of the current row in a
recordset being looped over are local variables within a UDF/CFC
method.  If you're within multiple recordset loops, the innermost has
highest priority, and references to fields from loops outside the
innermost must be fully qualified.  If you have a local variable that
matches a recordset field, you must fully qualify the recordset field,
even if it's from the innermost recordset loop.

cheers,
barneyb

On 5/24/07, Tony <[EMAIL PROTECTED]> wrote:
> Strange cfloop behaviour, that i'm not sure, isnt a coldfusion bug.
>
> cf7 and another unnamed version :) i see the same behaviour...
>
> 1. i have a query that returns a small recordset, 15 records
> 2. i have a cfloop that runs through that recordset, and for each
> record, it performs
> a cfquery gets some data, and for each record of the second query, i use a 
> value
> from the first query and insert it into the database, one row for each
> record of
> the 2nd query.
> 3. if i set the value i need to inject OUTSIDE of the 2nd cfloop tag,
> the value is
> fine, and i can use it inside the 2nd cfloop tag.
> 4. if i dont, and i just reference the value by name, it never gets
> past the value
> of the 1st record of the first recordset. and i end up with 15 of the same 
> value
> being used inside the 2nd cfloop tag for the insert query.
> 5. everything has prefix names, everything is being referenced by
> name, etc... the code
> checks out just fine, just never gets past index value 1.
> 6. i havent tried it using notation like this "qryTest.value[1]" but i
> didnt think i had to, i
> always thought if i had named variables and values, etc... that having
> nested loops like
> that wouldnt make a diff?
>
> help? i have figured out how to code around this, but it just doesnt seem 
> right?
>
> tw
>
>
>
> --
> 'Never have anything in your life that you can't walk out on in thirty
> seconds flat, if you spot the heat coming around the corner'
>
> robert deniro - heat (1995)
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279088
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to