Aug 30, 2010

ColdFusion Lists, SQL IN and cfqueryparam

We had a tiny issue where a SQL statement was trowing an error on one of our servers this was due to a '  in a value in a list in an IN statement.  It was an old block of code and was not using .  While using preserveSigleQuotes would suffice I prefer the list="true" attribute on cfqueryparam.

Here are 3 demos ( no cfqueryparam, cfqueryparam and full cfscript )

Here is the demo in action:  http://railo.kukiel.net/listin/

2 comments:

  1. Great tip Man, I always forget about that attribute.
    ReplyDelete
  2. One thing to remember is that an empty list will produce an error.
    ReplyDelete