Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thanks, @jane-e . This is indeed the correct forum for the post.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Hi,
Maybe this is a dumb question, but do you really have a column named same way as the table "SalesExec" ?
Regards
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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".
Copy link to clipboard
Copied
@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.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more