Skip to main content
Inspiring
April 7, 2008
Answered

Query of Queries Case Sensitive

  • April 7, 2008
  • 1 reply
  • 732 views
Ok, so I'm sure everyone already knows that Query of Queries in ColdFusion 7+ is case-sensitive. Everywhere I go, including CF Documentation, states to use the LOWER() or UPPER() function in the QoQ to get around this. I am still receiving an exception when I try to do this. Here are two examples of what I've, neither of which works:

<cfquery name="qParameters" dbtype="query">
SELECT ParamIdNmb, LOWER(ParameterName) AS ParameterName_lower
FROM qReportTypeParams
</cfquery>

<cfquery name="qParameter" dbtype="query">
SELECT ParamIdNmb
FROM qReportTypeParams
WHERE LOWER(ParameterName) = '#LCase(some_variable)#';
</cfquery>

However, in the same file, this DOES work:

<cfquery name="qReportColumnParameter" dbtype="query">
SELECT ParamIdNmb
FROM qReportTypeParams
WHERE UPPER(ParamName) = UPPER('param1')
</cfquery>

Does anyone have any thoughts? Does it have anything to do with these queries being in a CFC?

Please help.

Thank you.




    This topic has been closed for replies.
    Correct answer ericbelair
    I found the source of the problem. I have records in my recordset where the value of that column in my condition is NULL. I added ISNULL() functions to my SQL query, and this fixed the problem.

    1 reply

    ericbelairAuthorCorrect answer
    Inspiring
    April 7, 2008
    I found the source of the problem. I have records in my recordset where the value of that column in my condition is NULL. I added ISNULL() functions to my SQL query, and this fixed the problem.