As much as I love databases and writing SQL, the reality is, I’m not a “database admin”. And, I don’t have the best grasp of how databases work their magic under the hood. This leaves me open to many misunderstandings; one of which appears to be the way that the CFQuery and CFQueryParam tags work with the MySQL JDBC Driver (MySQL Connector/J 5.1) when used in ColdFusion / CFML. I believe that my understanding of the caching and performance benefits have been way off-base.

To set the stage for this post, I’ve been thinking a lot about my use of the [CFQueryParam](https://www.bennadel.com/blog/3805-considering-mysql-cfqueryparam-prepared-statements-and-sql-queries-that-use-in-clauses-in-coldfusion.htm) tag within [IN ()](https://www.bennadel.com/blog/3805-considering-mysql-cfqueryparam-prepared-statements-and-sql-queries-that-use-in-clauses-in-coldfusion.htm) clauses; and, specifically about how the [CFQueryParam](https://www.bennadel.com/blog/425-coldfusion-cfqueryparam-list-attribute-is-sweeet.htm) tag works with lists of values; and, how those dynamic queries may be filling up the prepared statement cache in the database (since a new prepared statement would theoretically be created for each unique-length of IN () value).

#coldfusion #sql

I've Had Fundamental Misunderstandings Of How CFQueryParam Works
1.10 GEEK