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:207861
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

Reply via email to