Query of query... 'like' operand error !!!

  • 26
  • May 2012
  • Dev @ Contech Lab
  • View: 18035 | 0 Comments

  • coldfusion | queryofquery

  • Today, I happened to be a serious mistake in the use of query or query. I lost half an hour to figure out where the problem was.

    A simple query of query like this:

    view plain print about
    <cfquery name="myQQ" dbtype="query">
    select field1 from TBL_MASTER WHERE field2 like ' #myVar#'
    </ cfquery>

    After a half hour test I found that the problem was in the myVar variable that was always compared in a "case sensitive". I had never noticed this detail.

    Someone can give me more information?

    The system is Win Coldfusion 8 with MS Sql Server 2008