I couldn't get this one to work but I did get it to work with the "session.#column_name#". It now gives a different message that a column is undefined. I'll go looking into that now and see how it goes. Maybe once I fix that problem, this version will work too. The problem may be that I have no records yet. I'll see.
thanks! >Or much easier > ><cfset session[column_name] = project_Retrieval[column_name][currentRow]> > > >-------------- >Ian Skinner >Web Programmer >BloodSource >www.BloodSource.org >Sacramento, CA > >"C code. C code run. Run code run. Please!" >- Cynthia Dunning > >...-----Original Message----- >...From: Ben Mueller [mailto:[EMAIL PROTECTED] >...Sent: Friday, May 27, 2005 8:32 AM >...To: CF-Talk >...Subject: setting session vars to database field values >... >...I'm pretty sure that you don't need the evaluate in the first part of >...your <cfset statement. >... >...<cfset evaluate('session.#column_name#') = >...evaluate('project_retrieval.#column_name#')> >... >...The evaluate statement is going to try to return a value, but you don't >...have a value for session.#column_name# yet. >... >...Try this instead: >... >...<cfset "session.#column_name#" = >...evaluate("project_retrieval.#column_name#")> >... >...There may be other issues with your code, but that's the one that stood >...out to me. >... >... >... >...>I have a database with an unknown field set. I want to take whatever >...>is in the DB and make a session variable for it. >...> >...><cfif structKeyExists(form,'project_category')> >...> <cfset project_id = evaluate('form.#form.project_category#')> >...> <CFQUERY name="table_dsc" datasource="dpch"> >...> select column_name >...> from user_tab_columns >...> where upper(table_name) = upper('empower_project_data') >...> ORDER BY column_name >...> </CFQUERY> >...> >...> <CFQUERY NAME="project_retrieval" DATASOURCE="dpch"> >...> SELECT * >...> FROM empower_project_data >...> WHERE project_id = #project_id# >...> </CFQUERY> >...> >...> >...> >...> </cfif> >...> >...> <cfoutput query="table_dsc"> >...> #column_name#<br> >...> >...> <!--- this part doesn't work ---> >...> <cfset evaluate('session.#column_name#') = >...>evaluate('project_retrieval.#column_name#')> >...> >...></cfoutput> >...> >...>This gives an error that you can't set a value to a function, which I >...>understand. I'm not sure how to set a session var where I want it to >...>be the same name as the column in the database, without knowing that >...>column name ahead of time. >...> >...>-- >...>Daniel Kessler >...> >...>Department of Public and Community Health >...>University of Maryland >...>Suite 2387 Valley Drive >...>College Park, MD 20742-2611 >...>301-405-2545 Phone >...>www.phi.umd.edu >... >... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207890 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=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

