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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:207865
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