Nice & tidy Alex, thanks, I'll use this. :-) -----Original Message----- From: Alexander Sherwood [mailto:[EMAIL PROTECTED] Sent: 12 October 2005 20:05 To: CF-Talk Subject: Re: Loop through a structure of structures
Try this: [CFLOOP collection=RSStructure item="itm] [cfset thisQuery =RSStructure[itm]] [cfoutput query =thisQuery] .. query output code here [/cfoutput] [/CFLOOP] Hope this helps. -- Alex Andy Mcshane wrote: >Hi all, I think I have been looking at this for too long and cannot figure out how to loop through and output a structure of query results. > >I have a CFC that will return multiple recordsets. I figured that the only way that I could return multiple recordsets from a CFC was to return them within a structure. My query runs inside my CFC and returns 17 individual recordsets. I create a structure and add each of these recordsets to it so my structure now looks like this; > >RSStructure > RS1 query - Rows 2 > AGE ID NAME > 1 22 1 Wibble > 2 21 2 Wobble > RS2 query - Rows 3 > AGE ID NAME > 1 22 3 Wibble > 2 21 4 Wobble > 3 30 5 Woo > RS3 query - Rows 3 > AGE ID NAME > 1 34 6 Wibble > 2 23 7 Wobble > 3 33 8 Woo > >This continues until I have 17 recordsets within my structure. I then return this structure to my calling page. Now I must be having a really brain dead day because for the life of me I cannot remeber how to reference each of my recordsets within this structure so that I can output the data, it must be simple but then again so must I be at the moment! Can anybody help this flagging programmer? > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220876 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54