Way to go Railo!

Well, even though it's unlikely that a valid SQL query would contain a
struct for a row (can it?), inserting a struct into a query variable is
allowed.

CF looks at the first record of a query variable whenever you reference
a column from it outside of a query-looping structure like with <cfloop
query=""> or <cfoutput query="">

So, in this case, when you reference myQuery.Advanced[2] you are
actually looking at the value of the key "2", from the "Advanced" column
of the FIRST row of myQuery, which has 3 keys: CITY, FIRSTNAME,
LASTNAME, which is VALID, but NOT EXPECTED.

Railo looks at a query variable as a structure anyway, so when you
reference myQuery.Advanced[2], it finds the 2nd row of the query, since
it's just a regular structure, which is AS EXPECTED.

That is why this will fail in CF, but work in Railo:

<cfdump var="#myQuery["Advanced"]["2"]["1"]["lastname"]#" />

The discussion should be that Adobe CF, or CFML (the language) should be
smart enough to know that when I reference query["column"][2], that I'm
trying to get to the 2nd record's column (which is more intuitive), and
not the value of the "2" key of the 1st record's column.

- Rex

Gert Franz wrote:
> Just a side note...
> 
> Railo returns StructCount = 2 and dumps a struct with two keys 
> containing 3 keys. I guess as expected.
> 
> Greetings from Switzerland
> Gert Franz
> Railo Technologies GmbH
> [EMAIL PROTECTED]
> www.railo.ch
> 
> Join our Mailing List
> german:    http://de.groups.yahoo.com/group/railo/
> english:   http://groups.yahoo.com/group/railo_talk/
> linked in: http://www.linkedin.com/e/gis/71368/0CF7D323BBC1
> 
> 
> 
> to schrieb:
>> hi all,
>>
>>
>> i'm wondering if this has also happened to you (see code below)
>>
>> myQuery.Advanced[2] in CF7 results in a struct with "Totti" & "Del Piero",
>> but in CF8 gets "Lemont"
>>
>> what funny is that structcount result is 3 (!?!?)


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315126
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