Title:
Bug 80196:An empty list passed to <cfqueryparam cfsqlype="cf_sql_integer" value="#list#" list="true"/> causes an exception to be thrown (because "" is not a valid integer)
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Sean Corfield / Sean Corfield (Sean Corfield)
Created: 09/26/2009
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 9,0,0,251028 / 261107
Priority/Frequency: Minor / Unknown
Locale/System: English / Platforms All
Vote Count: 1
Problem:
An empty list passed to <cfqueryparam cfsqlype="cf_sql_integer" value="#list#" list="true"/> causes an exception to be thrown (because "" is not a valid integer). This is plain silly! WHERE x in ( <cfqueryparam cfsqltype="cf_sql_integer" value="#emptylist#" list="true"/> ) should work and yield WHERE x in ( ) which is valid SQL and matches no rows.
Method:
See code example above. You end up having to test trim(list) is not "" and conditionally doing something different in your query which is a mess.
Result:
'' invalid CF_SQL_INTEGER value (or something like that)
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3040214
External Customer Info:
External Company:
External Customer Name: Sean Corfield
External Customer Email: 479B4EDC43F3A88B992016B6
External Test Config: 09/26/2009
Attachments:
Comments: