Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
mattw #1
Accessing a Query in a structure
I am creating a session variable that is a structure. Each key in the structure
stores a query that I created via QueryNew. I can output the query via cfdump
and I can also access a value from the first row by accessing the column
directly, but when trying to loop through the query, I get an error. Example
lines of code follow:
Outputs the query in its entirety:
<cfdump var="#session.CurrentRegInfo[747]#">
Outputs the RegID field for first row:
#session.CurrentRegInfo[747].RegID#
Throws error
<cfloop query="session.CurrentRegInfo[747]">
Error thrown:
The value of the attribute query, which is currently
"session.CurrentRegInfo[747]", is invalid.
Anyone with any ideas here?
Matt
mattw Guest
-
Newbie 'structure' design query
I am trying to design a database to hold company names, company contacts, individuals etc. I'm new to databases, have read until my head hurts, but... -
Copy a table in Access structure only with CF query
Hello, I need to know how to create a new table by copying an existing table with the table structure only in a query Don't know the Syntax but... -
Query w/bad table structure
Hi, I am trying to query a column that has multiple values. When I export it, I need to have it so that each of those values is placed in its own... -
Query to Structure?
Hi. I wanted to ask if someone knew how to do the following: I have a structure and a query. <cfset myStruct = StructNew()> <cfset... -
query to return table structure
hi, Is there any command or query that returns the table structure informix. -
Kronin555 #2
Re: Accessing a Query in a structure
Is SESSION.CurrentRegInfo the query? if so, you need to take the [747] out of your <cfloop> call...
<cfloop query="SESSION.CurrentRegInfo">
Kronin555 Guest
-
mattw #3
Re: Accessing a Query in a structure
No, session.CurrentRegInfo is the structure. The first key in this structure is
[747]. That key holds a query. The cfdump tag I posted outputs a query. Maybe
there is an issue with a structure key being numeric. I'll try that and get
back...
mattw Guest
-
mattw #4
Re: Accessing a Query in a structure
Okay, so adding some letters before the numbers did nothing. However, I have
found a fix. Set a variable to hold the query.
<cfset tmp_qry = session.CurrentRegInfo[747]>
<cfloop query="tmp_qry">
...
This seems to work, although it seems I shouldn't have to do this. Perhaps I
found an Undocumented Feature (bug).
Matt
mattw Guest



Reply With Quote

