1

Do I have to use cfqueryparam for static values?

Say I have this as my where clause:

WHERE status = 1

Is there any benefit when doing it like:

WHERE id = <cfqueryparam value="1" maxlength="32" cfsqltype="cf_sql_integer">

I use that 1 value repeatedly throughout my queries.

Kevin
  • 327
  • 6
  • 17
  • 4
    possible duplicate of [Using cfqueryparam with constants](http://stackoverflow.com/questions/26141672/using-cfqueryparam-with-constants) – Dan Bracuk Apr 28 '15 at 01:35

1 Answers1

3

You do not need to. There is no security gain from param'ing static text.

However there is a performance gain in query optimization so it is still a gain to do so but this only applies when a new query must be run, so its not a gain beyond the first run of a static query.

Always param variables though.

Regular Jo
  • 5,190
  • 3
  • 25
  • 47