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

Coldfusion Oracle query results are inaccurate

New Here ,
Jul 30, 2010 Jul 30, 2010

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?

1.0K
Translate
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
Valorous Hero ,
Jul 30, 2010 Jul 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
Translate
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 ,
Jul 30, 2010 Jul 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

Translate
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
New Here ,
Jul 30, 2010 Jul 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.
Translate
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
Enthusiast ,
Jul 30, 2010 Jul 30, 2010

CF results Records=5845

Is this number the value of getUser_ac.recordCount?

Translate
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
Valorous Hero ,
Jul 30, 2010 Jul 30, 2010

When you say "CF Driver Oracle" are you refering to the Oracle Native JDBC 4 Driver that is only available in ColdFusion Enterprise and Developer?  Or are you using the Oracle Thin Client, or heaven's forbid, the Oracle ODBC driver?  Or possible some other Oracle driver?

Translate
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 ,
Jul 30, 2010 Jul 30, 2010

In what way were they different?

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

Translate
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
New Here ,
Jul 30, 2010 Jul 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.

Translate
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
Enthusiast ,
Jul 30, 2010 Jul 30, 2010

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

Translate
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 ,
Jul 30, 2010 Jul 30, 2010
LATEST

If this were my problem, I'd identify the TOAD records that did not get returned by ColdFusion and try to figure out why.  One thing I'd be looking for would be leading or trailing spaces in sibint.sibinst_fcst_code.

Translate
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