Copy link to clipboard
Copied
So I have decided to try CF11 because of an official outstanding CF10 bug.
Once I installed CF11, I get an error when running code like this:
<cfquery name="LOCAL.stat_questions" datasource="#APPLICATION.dsn#">
SELECT survey_questionID
FROM tbl_survey_questions
;
</cfquery>
<cfset LOCAL.this_statID = 1>
<cfquery name="LOCAL.subset" dbtype="query">
SELECT survey_questionID
FROM [LOCAL].stat_questions
WHERE survey_questionID = <cfqueryparam cfsqltype="cf_sql_numeric" value="#LOCAL.this_statID#">
;
</cfquery>
The error I receive is: "Query Of Queries syntax error.
Encountered ";. "
If I remove the semi-colon... No error! Is this a bug, or was the semi-colon always bad, but just ignored?
Thanks
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hmmm. Learn something new everyday. When I read the issue my initial thought was that the semi-colon was a syntax error in the query string. I have never seen nor needed this in a CF query before. But since the bug link acknowledges it's a bug, I guess the semi-colon is valid. Just for clarification, can someone tell me why it would be used (since in this example the use is superfluous)?
Copy link to clipboard
Copied
I just always put it in out of habit from typing out actual MySQL queries (non QoQ). Never was a problem and I always did it. Now running CF11... it requires fixing. Thought it was strange.
I actually didn't even notice that the semi-colons weren't required in QoQ until I ran into this CF11 bug. I also notice the semi-colon isn't necessary for a MySQL query either in cfquery! Seems weird that it accepts them, but isn't required. Just ignores them?