Skip to main content
December 5, 2008
Answered

How to evaluate a double dereference?

  • December 5, 2008
  • 3 replies
  • 436 views
I am so stuck on this problem. Please tell me how it can be solved.

q1 and q2 are result sets from a database.

q1.status = "approved"

q2.field = "prompt: #q1.status#"

I need some syntax to evaluate q2.field so that it prints "prompt: approved"

I tried Evaluate() and <cfoutput>#q2.field#</cfoutput> but nothing seems to work.

Thank you in advance.
This topic has been closed for replies.
Correct answer Dan_Bracuk
Storing code in a db and trying to select it and execute it won't work unless you write the query output to a file first and then include the file. This usually makes it a bad idea.

3 replies

Dan_BracukCorrect answer
Inspiring
December 5, 2008
Storing code in a db and trying to select it and execute it won't work unless you write the query output to a file first and then include the file. This usually makes it a bad idea.
December 10, 2008
Thanks Dan. Using cffile worked great.
Inspiring
December 5, 2008
i think you may have misinterpreted the op's question... or aybe i have...
but the way i read it is, the op has one db table with a column with a
value 'approved' and [another db table with a] column with actual value
'prompt: #q1.status#', and he expects his output of querying the second
column/table to replace the #q1.status# with his result of querying the
first column/table... which won't ever work...

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
December 5, 2008
That's right Azadi. I should have mentioned that the result sets have only one row each. I will try Dan Bracuk's idea, when I go back to work on Monday.

Thank you
Inspiring
December 5, 2008
wolfv wrote:
> I am so stuck on this problem. Please tell me how it can be solved.
>
> q1 and q2 are result sets from a database.
>
> q1.status = "approved"

QuerySetCell(q1, "status", "approved", #Row_number#) - Row_number is
usually CurrentRow

> q2.field = "prompt: #q1.status#"

Use QuerySetCell

--
Mack