On insertion, when I supply 20 or fewer c" /> On insertion, when I supply 20 or fewer c" /> On insertion, when I supply 20 or fewer c"/>

coldfusion.tagext.sql.QueryParamTag$InvalidDataException: Invalid data value [Column Name] exceeds maxlength setting 20

214 Views Asked by At

I have an email field.

 <cfqueryparam cfsqltype="cf_sql_nvarchar"  maxlength="200" value="#structform.Email#">

On insertion, when I supply 20 or fewer characters as input, then insertion goes successful but when I supply more than 20 characters, then I get an exception.

The cause of this output exception was that: coldfusion.tagext.sql.QueryParamTag$InvalidDataException: Invalid data value [email protected] exceeds maxlength setting 20..

Given that in the database (SQL server) the length of this field is 200. and the following insert query successfully run

 Insert into table (Email) values ('ggggggggggggggggtttttttttttttttttttttttttttttggggggggggggggggg@gmail.com')

The input is greater than 20 charachetr.

1

There are 1 best solutions below

0
Mike Striker On BEST ANSWER

May be some where else in your code you have the maxlength set. Also check the SQL where clauses. Please also check the max length attribute in the cfqueryparam. You may have explicitly defined it in your code.