• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

query withing query loop

Participant ,
Mar 20, 2008 Mar 20, 2008

Copy link to clipboard

Copied

Hi all,

This is the situation that I have
<query1>
<cfloop query1>
<query2>
<cfoutput query2>
<cfoutput query2>
</cfloop>
</cfloop>
Lets say that query2 has 2 rows, I am getting data from row1 in row2 where row2 fields are empty.
So if I have row1 query2.name = 'mike' I'll get that same value in row2 if the row2 name is blank?
TOPICS
Advanced techniques

Views

246

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 20, 2008 Mar 20, 2008

Copy link to clipboard

Copied

LATEST
TiGGi wrote:
> Hi all,
>
> This is the situation that I have
> <query1>
> <cfloop query1>
> <query2>
> <cfoutput query2>
> <cfoutput query2>
> </cfloop>
> </cfloop>
> Lets say that query2 has 2 rows, I am getting data from row1 in row2 where
> row2 fields are empty.
> So if I have row1 query2.name = 'mike' I'll get that same value in row2 if the
> row2 name is blank?
>


A) Nine times out of ten when one has logic like this it can be
simplified with a single join query and a single query output loop.

B) When one does do logic like this, one almost always has to use fully
qualified query references. Otherwise ColdFusion gets confused about
what row of each query is being output and just outputs the first row.

A fully qualified query reference is #queryName.column[row]# OR
#queryName['column'][row]#

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation