• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to evaluate a double dereference?

Guest
Dec 04, 2008 Dec 04, 2008

Copy link to clipboard

Copied

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.
TOPICS
Advanced techniques

Views

390

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Dec 05, 2008 Dec 05, 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.

Votes

Translate

Translate
LEGEND ,
Dec 05, 2008 Dec 05, 2008

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 05, 2008 Dec 05, 2008

Copy link to clipboard

Copied

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/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 05, 2008 Dec 05, 2008

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 05, 2008 Dec 05, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 09, 2008 Dec 09, 2008

Copy link to clipboard

Copied

LATEST
Thanks Dan. Using cffile worked great.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation