Skip to main content
Participant
April 2, 2007
Question

Need help - Get data from ResultSet

  • April 2, 2007
  • 5 replies
  • 498 views
Dear all,

I'm kinda new into CFM. In fact, in another word, I got totally no experience on cfm.

I am now working on a project to troubleshoot the cfm page. The problem occur when :
1. User click on listing to action page
2. Action page throw exception on a variable is undefined in session.

I'd found the following code in the action page which look weird to me and it might cause the problem:

<CFQUERY NAME = "PROJ" DATASOURCE="#TESTSOURCE#>
Select PROJ.PRONAME from Project PROJ where PROJ.PROCODE = '1234'
</CFQUERY>

<CFSET session.PROJNAME = #PROJ.PRONAME#>

The exception throw is "Element PROJNAME is undefined in SESSION"

Appreciate for any fast reply. Thanks in advance!
This topic has been closed for replies.

5 replies

Participant
April 3, 2007
thanks... I miss out the double quote...
Inspiring
April 2, 2007
Actually there is a syntax error.

DATASOURCE="#TESTSOURCE#> should be

DATASOURCE="#TESTSOURCE#">

Doug
Inspiring
April 2, 2007
Yes, this line is the same so no problem there.

I can't see any syntax errors in the code, and the cfset code should create the variable PROJNAME in the session struct so I can't quite see how it can be undefined after this line.

Add the line <cfdump var="#PROJ#"><cfabort>

temporarily immediately after </CFQUERY> to see if the query is returning what you expect.

Doug
Participant
April 2, 2007
Thanks for the reply. I have found the Application.cfc but I can't find the line in the file. There is another line which look alike though:

<CFAPPLICATION Name="Promise" SessionManagement="Yes" SessionTimeout="#CreateTimeSpan(0, 0, 60, 0)#">

Does this work as well?

On another note, does the code posted previously correct?


Inspiring
April 2, 2007
Check to ensure that this line:

<cfset this.sessionmanagement=true>

is present in the Application.cfc page.

Doug