Today I ran across the first instance in which I needed to pass a comma delimited list to a Data Access Object to use as query criteria. As these items were in a list, the DAO needed to convert the list to a quoted value list before passing it off to the query object. Usually in this case I would use QuotedValueList, which I use quite often, but since I was passing a string to the DAO and not a query object, this function would not work in this case. However, ListQualify() did the trick.
Essentially all that I had to do to convert the non-quoted list to a quoted list was:
ListQualify(ListName,”‘”,”,”,”all”);
Good stuff. It’s interesting that I actually haven’t needed/came across this function before even though I work with lists pretty frequently.
2 Responses
dave ross
27|Feb|2004 1can’t you use cfqueryparam with list=”yes” in this situation?
Brandon
28|Feb|2004 2Yes, for a static query that would work. However, when working with a DAO, everything is built and sent dynamically to the object which actually runs the query, so it’s not really productive to try to work with cfparam in that situation (as long as you are verifying the data before it makes it there), IMHO.
Leave a reply