<p>I have been tasked with going through a number of ColdFusion sites that have recently been the subject of a rather nasty SQL Injection attack.  Basically my work involves adding <code>&lt;cfqueryparam</code>> tags to all of the inline sql.  For the most part I've got it down, but can anybody tell me how to use cfqueryparam with the LIKE operator?</p>

<p>If my query looks like this:</p>

<pre><code>select * from Foo where name like '%Bob%'
</code></pre>

<p>what should my <code>&lt;cfqueryparam</code>> tag look like?</p>

@Joel, I have to disagree.
```
```
select a,b,c
from Foo
where name like <cfqueryparam cfsqltype="columnType" value="%#variables.someName#%" />
```
```
Never suggest to someone that they should "select star." Bad form! Even for an example! (Even copied from the question!)
The query is pre-compiled and you should include the wild card character(s) as part of the parameter being passed to the query. This format is more readable and will run more efficiently.
When doing string concatenation, use the ampersand operator (&), not the plus sign. Technically, in most cases, plus will work just fine... until you throw a NumberFormat() in the middle of the string and start wondering why you're being told that you're not passing a valid number when you've checked and you are.