The error template reports "The cause of this output exception was that: coldfusion.tagext.sql.QueryParamTag$InvalidDataException: Invalid data value 50 exceeds maxlength setting 2.."
The data comes a table where the field is longer than 2 but is trimmed before being assigned into an application variable and then put in a select-option element. On test system, foutputted len() of the variable and got 2.
The error happens on the real system but doesn't happen on the test system.
Hoping for permission to put same debug in real system.
What could cause this error?
Why not just wrap the query up in a try/catch, and mail yourself the exact details and what data's going in? Clearly it's longer than two, else it wouldn't throw an error. No reason speculating, the value could be anything.
CF_SQL_CHARACTER is not a valid value in that situation. You probably mean CF_SQL_CHAR.
See the full list here:
As to why it's working at all, that's a bit of mystery, but I'd fix that just in case you're seeing a vagary of bad code rather than anything else.
What you could be seeing is CF doing something odd with "50" when it converts it to an [unknown type], and because of its loose-typed-ness it ends up being "50.0" or something like that. It might be down to which JVM version you're running on your various servers as to how it's handled.
Use legit CFML code first and see if the problem goes away... if not, we can revisit...
As to why it's working at all, that's a bit of mystery
CF9 defaults to "char" when the type is invalid (possibly earlier versions too). So you could use cf_sql_foobar and it would just fall back to cf_sql_char anyway. Obviously you should stick with valid types or you lose some of the benefits ...