Skip to main content
March 5, 2012
Question

cfqueryparam problem

  • March 5, 2012
  • 1 reply
  • 1571 views

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?

    This topic has been closed for replies.

    1 reply

    Inspiring
    March 5, 2012

    Let's see the <cfquery> that's erroring...

    --

    Adam

    March 5, 2012

    The whole query is too much to put in here. Here is the line         ,cncode        =<cfqueryparam value="#cncode#" cfsqltype="CF_SQL_CHARACTER" maxlength="2">.

    Works on test but not on real live.

    Owainnorth
    Inspiring
    March 5, 2012

    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.