Still using CF5 at my work, and using CFMX6.1 at home, I was a bit astonished this issue came up also in CFMX6.1? What causes this behaviour? I cannot imagine it is truly a bug, but I cannot figure out why this behaviour is in CFMX?
When you loop over two query resultsets, the second nesting often cannot handle it's parent variables, despite it has been referenced with the query name, could someone enlighten me?
The output this code gives is, and qryRootnodes.cultureid doesn't give the correct data back unless it is set into another variable, here set in <cfset test = qryRootnodes.cultureid>
culture_4225 - should be 4225
culture_4225 - should be 4225
culture_4225 - should be 4224
culture_4225 - should be 4224
<!--- init rootnodes --->
<cfquery name="qryRootnodes" datasource="#Request.Application.DSN#">
SELECT RC.instanceid, I.Label, RC.cultureid, RC.handle
FROM RootnodeConfiguration RC
JOIN Instance I ON (I.instanceid = RC.instanceid)
WHERE RC.departmentid = #session.departmentid#
OR RC.userid = #session.userid#
</cfquery>
<cfquery name="qryCultures" datasource="#Request.Application.DSN#">
EXEC dbo.upu_Instance_GetChildren
@ParentID = #session.domaininstanceid#,
@ObjectType = #Request.Object.object_Culture.type#,
@SortField = 'Label'
</cfquery>
<cfset stTmp = structNew()>
<cfloop query="qryRootnodes">
<cfset test = qryRootnodes.cultureid>
<cfif NOT structKeyExists(stTmp,handle)>
<cfset stTmp["#handle#"] = structNew()>
</cfif>
<cfloop query="qryCultures">
<cfoutput>
culture_#qryRootnodes.cultureid# - should be #test#<br>
</cfoutput>
<cfset stTmp["#qryRootnodes.handle#"]["culture_#qryRootnodes.cultureid#"] = qryRootnodes.instanceid>
</cfloop>
</cfloop>
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
- Re: Strange query "bug" still in CFMX Micha Schopman
- Re: Strange query "bug" still in CFMX Barney Boisvert
- Re: Strange query Micha Schopman