Need help - Get Data from ResultSet

Discussion in 'Programming' started by NewbieNoob, Apr 2, 2007.

  1. #1
    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!
     
    NewbieNoob, Apr 2, 2007 IP
  2. IsRoss()

    IsRoss() Peon

    Messages:
    116
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Are you sure your query is returning any data? You can put this in to find out:

    <cfdump var="#proj#"><cfabort>

    If PROCODE is an integer, you will need to lose the quotes:

    ...where PROJ.PROCODE = 1234

    You should also CFLOCK when setting session variables:

    <cflock type="session" scope="exclusive" timeout="30">
    <cfset session.foo = #foo#>
    </cflock>

    Hope that helps...
     
    IsRoss(), Apr 2, 2007 IP
  3. NewbieNoob

    NewbieNoob Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks....I will check that :p
     
    NewbieNoob, Apr 2, 2007 IP
  4. datropics

    datropics Peon

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #4
    IsRoss() is correct - the error may infact be further down but carry out IsRoss()'s instructions and let us know the results
     
    datropics, Apr 2, 2007 IP