Thanks for the tip and code, Alan & Barney! It's working great! I was concerned that I may end up having to hard-code the variables and that would greatly reduce the reusability of the cfc.
Rick > -----Original Message----- > From: Barney Boisvert [mailto:[EMAIL PROTECTED] > Sent: Monday, June 16, 2008 11:57 PM > To: CF-Talk > Subject: Re: Would this create session variables? > > try this: > > <cfloop list="#get_agent.columnList#" index="i"> > <cfset session[i] = get[i][1] /> > </cfloop> > > cheers, > barneyb > > On Mon, Jun 16, 2008 at 8:44 PM, Rick Faircloth > <[EMAIL PROTECTED]> wrote: > > Would this part of a cffunction create > > individual session variables from the query? > > > > <cfquery name="get_agent" datasource="c21ar"> > > SELECT * > > FROM our_agents > > WHERE website = '#arguments.website#' > > </cfquery> > > > > <cfset session.get_agent = get_agent /> > > > > <cfif get_agent.recordCount> > > > > <cfreturn session.get_agent/> > > > > Back on the invoking page, the returnvariable > > is 'get_agent'. > > > > I've tried to access the specific field data > > from the cfreturn as session variables, such as: > > > > session.agent_header (agent_header is defined by the query) > > > > but I'm getting an error that session.agent_header isn't defined. > > > > Based on the cfdump data, it looks like the entire query is becoming > > a session variable (???) rather than getting all the query data > > defined as individual session variables. > > > > I'm trying to get... > > > > session.agent_header = '#get_agent.agent_header#' > > session.first_name = '#get_agent.first_name#' > > > > without manually coding all the variables. > > > > etc. > > > > Thanks, > > > > Rick > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307664 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

