Skip to main content
Participant
July 23, 2025
Question

Query not displaying and errors

  • July 23, 2025
  • 5 replies
  • 308 views

                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!

    5 replies

    BKBK
    Community Expert
    Community Expert
    July 24, 2025

    @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.

     

    Charlie Arehart
    Community Expert
    Community Expert
    July 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)
    Participating Frequently
    July 23, 2025

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

    Community Expert
    July 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
    BKBK
    Community Expert
    Community Expert
    July 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.

    jane-e
    Community Expert
    Community Expert
    July 23, 2025

    @ian_3593 

     

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

     

    Jane

    BKBK
    Community Expert
    Community Expert
    July 23, 2025

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