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

Query not displaying and errors

New Here ,
Jul 23, 2025 Jul 23, 2025

                We have been using CF for a long time. Yesterday we had a power cut and after a restart the following is happening (just a test page to identify issues):

 

<cfquery datasource="#mydb#">

                UPDATE iantest

                set

                test = 55

                where id = 1

                </cfquery>

                               

This Works - updates the DB correctly but displays the error message: The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.

Null Pointers are another name for undefined values.

 

                <cfquery name="salesexecs" datasource="#mydb#">

                SELECT *

                FROM SalesExec

                ORDER BY initials, SalesExec

                </cfquery>

 

This one doesn’t work at all

 

Help!

362
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
Community Expert ,
Jul 23, 2025 Jul 23, 2025

@ian_3593 

 

I've moved your post from Using the Community to the Cold Fusion forum.

 

Jane

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
Community Expert ,
Jul 23, 2025 Jul 23, 2025

Thanks, @jane-e . This is indeed the correct forum for the post.

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
Community Expert ,
Jul 23, 2025 Jul 23, 2025

@ian_3593 ,

The fact that the query-update works suggests that something else is causing the error.  Have a look at the logs, in particular, exception.log. What do they say about the error? Share the error-message(s) in full.

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
Community Beginner ,
Jul 23, 2025 Jul 23, 2025

Hi,
Maybe this is a dumb question, but do you really have a column named same way as the table "SalesExec" ?
Regards

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
Community Expert ,
Jul 23, 2025 Jul 23, 2025

That's not a dumb question at all! The OP should try a less ambiguous query. Something like:

 

SELECT se.firstName, se.lastName 

FROM SalesExec se

ORDER BY se.initials, se.SalesExec

 

The OP should get rid of "*" and replace it with a definitive list, using the actual field names to be selected from the SalesExec table, but I don't know what they are.

 

Dave Watts, Eidolon LLC
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
Community Expert ,
Jul 23, 2025 Jul 23, 2025

Beyond the helpful suggestions so far, I'd wonder instead if the error really is on the cfquery--as I'd not expect that error to result from that cfquery code, especially since the db update DID happen. 

 

Hopefully the suggestion to look for error messages in the cf logs will help confirm where the problem really is. 

 

If not, another option is that you could save a backup of the cf file, temporarily take out ALL code after that cfquery, and run it again. Would it now at least not error at all (yet still update the db)? If so, that proves it's NOT the cfquery, but something in the code you removed. 

 

And whatever that problem is might well be the same problem with the code following the select query which "doesn't work at all". 


/Charlie (troubleshooter, carehart. org)
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
Community Expert ,
Jul 24, 2025 Jul 24, 2025
LATEST

@ian_3593 , the table in the query

  <cfquery name="salesexecs" datasource="#mydb#">

                SELECT *

                FROM SalesExec

                ORDER BY initials, SalesExec

                </cfquery>

shares the same name as one of the columns, and so is likely to be incorrect.

 

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