Skip to main content
Participant
July 30, 2010
Question

Coldfusion Oracle query results are inaccurate

  • July 30, 2010
  • 4 replies
  • 1139 views

I have run the exact same query in toad and in oci8 php and get the same results. In coldfusion the results are different. I made sure the query is not being cached. What could be the reason for this?

    This topic has been closed for replies.

    4 replies

    aofficerAuthor
    Participant
    July 30, 2010

    I am absolutely positive that it is the same database and table. The TOAD query is 100% accurate but cfquery misses about a hundred records. I would show you the results but its very long.

    Inspiring
    July 30, 2010

    Do the table and/or login have any triggers associated with them?

    Inspiring
    July 30, 2010

    In what way were they different?

    Are you sure you were connected to the same database each time?

    aofficerAuthor
    Participant
    July 30, 2010

    DB version 11


    CF version 9
    CF driver oracle
    CF query

    <cfquery name="getUser_ac" datasource="oracle">
            SELECT sibinst_pidm as pidm
            FROM sibinst a
            WHERE a.sibinst_fcst_code = 'AC'
    </cfquery>
    <cfoutput>
        <cfloop query = "getUser_ac">
            #getUser_ac.pidm#<br>
          </cfloop>
    </cfoutput>

    TOAD query

    SELECT sibinst_pidm as pidm
    FROM sibinst a
    WHERE a.sibinst_fcst_code = 'AC'


    CF results Records=5845
    TOAD results Records=5912

    If you need more information let me know.
    Inspiring
    July 30, 2010

    CF results Records=5845

    Is this number the value of getUser_ac.recordCount?

    ilssac
    Inspiring
    July 30, 2010

    aofficer wrote:

    What could be the reason for this?

    1. Your not connecting to the database you think you are connecting to.
    2. Your not passing in the same parameters you think you are passing in
    3. Different database drivers
    4. Others that are hard to think of or consider without some more information on your part.
      1. Database version
      2. ColdFusion version
      3. example of the code
      4. example of the results
      5. etc
    Inspiring
    July 30, 2010

    Added to that list: different DB user.  That's what - in my (admittedly not comprehensive ~) experience - usually causes these things with Oracle.

    --

    Adam