20 Replies Latest reply: Feb 18, 2015 12:36 AM by BKBK RSS

    Problem with <cfqueryparam null="#ListFindNoCase('NULL',argument.name)#">

    Khovel Community Member

      This is my query i'm doing here:

       

               SELECT *

               FROM DB_NAME

               WHERE 0=0

                  <cfif arguments.NAME is not ''>

                     AND NAME_FIELD = <cfqueryparam value="#arguments.NAME#"  null='#ListFindNoCase("NULL",arguments.NAME)#'/>

                  </cfif>

            </cfquery>

       

      The resulting query ends up being

       

      SELECT *

      FROM DB_NAME

      WHERE 0=0

      AND NAME_FIELD = ''

       

      instead of being

       

      SELECT *

      FROM DB_NAME

      WHERE 0=0

      AND NAME_FIELD is NULL

       

      I am currently working in Coldfusion 9.