Skip to main content
Participant
April 22, 2008
Answered

Parsing query variable

  • April 22, 2008
  • 2 replies
  • 522 views
I am facing a problem while parsing query output variable.

Scenario:-
I have stored session variable name as the column value of a table.
Now I have used cfquery tag and get the result column value which is the session variable name. But cold fusion didn't parse that session variable with its actual value.

Step1- Table view by using cfdump tag
query - Top 1 of 1 Rows
PARAMETERNAME - PARAMETERVALUE
1 @matterspacename - #SESSION.Matter_space_Name#

Step2- Using cfquery tag to fetch data from table:-

<cfquery name="qSendNotification" datasource="#Database_DSN#">
select
ParameterName,
ParameterValue
from
Tbl_EventParameterDetails
where
NotificationEventID = 1
and IsActive = 1
</cfquery>

Step3- Now using result of cfquery output.
<cfset event_data= #qSendNotification.ParameterValue#>

Step4- When I used cfdump to display result value its shows as under:-

<cfdump var="#event_data#">

output:- #SESSION.Matter_space_Name#

Instead of parsing actual value of the session variable it displays the session variable name.

Please help me, How to parse this session value or if my code has some error, please suggest me any other way to handle this situation.

Thanks in advance




    This topic has been closed for replies.
    Correct answer BKBK
    In short when i dump the query result it just shows the session variable name as it is [#Session.Matter_space_Name#] instead of showing the actual session value of that variable.

    It simply comes down to this: you have stored the string "#Session.Matter_space_Name#" as data in the the parameterValue column. If that is not what you intended, go back to the code that inserted the data and change the value. Or perhaps, you intended to store the string Session.Matter_space_Name as parameterValue so that you can later get the value with

    evaluate(qSendNotification.ParameterValue).



    2 replies

    BKBK
    Community Expert
    BKBKCommunity ExpertCorrect answer
    Community Expert
    April 23, 2008
    In short when i dump the query result it just shows the session variable name as it is [#Session.Matter_space_Name#] instead of showing the actual session value of that variable.

    It simply comes down to this: you have stored the string "#Session.Matter_space_Name#" as data in the the parameterValue column. If that is not what you intended, go back to the code that inserted the data and change the value. Or perhaps, you intended to store the string Session.Matter_space_Name as parameterValue so that you can later get the value with

    evaluate(qSendNotification.ParameterValue).



    Participant
    April 23, 2008
    Its working...
    Tons of thanks :-)
    Inspiring
    April 22, 2008
    What happens when you dump the query? Do you see what you expected to see?
    Participant
    April 22, 2008
    when i dump the query it shows me the value that is stored in DB i.e. #Session.Matter_space_Name#.
    But when i store this value into a variable and then dump that variable it won't show me the actual value of this session variable's value.

    In short when i dump the query result it just shows the session variable name as it is instead of showing the actual session value of that variable.