Link to home
Start Free TrialLog in
Avatar of anup001
anup001

asked on

Error : String or binary data would be truncated.

I am trying to submit some form values to the database

However i am getting an error when i insert something like (E. Jensen) or N/o . or such special characters in text fields like street. The error is

Error Executing Database Query.  
[Macromedia][SQLServer JDBC Driver][SQLServer]String or binary data would be truncated.  
 
The error occurred in E:\docs_secure\icepe\addhvp.cfm: line 9
 
7 : values('#EVALUATE('form.sitename')#','#EVALUATE('form.street')#','#EVALUATE('form.city')#','#EVALUATE('form.region')#'
8 : ,'#EVALUATE('form.county')#','#EVALUATE('form.zip')#','#EVALUATE('form.state')#','#EVALUATE('form.colocator')#',
9 : '#EVALUATE('form.siteowner')#','#EVALUATE('form.hvpowner')#','#EVALUATE('form.hvptype')#','#EVALUATE('form.phone')#','#EVALUATE('form.note')#')
10 : </cfquery>
11 : <cfquery  name="getsid1" datasource="#dbdsn#" username="#dbuser#" password="#dbpw#">
 

--------------------------------------------------------------------------------
 
SQL    insert into site_info (sitename,street,city,region,county,zip,state,colocator_name,sowner_name,owner_hvp,type_of_hvp,phone_no,note) values('McCall','Leonard Avenue, (E. Jensen )','Fresno','' ,'','','CA','Larry Duba', 'PGE','Unknown','None','268-0441','')  
DATASOURCE   sqldatas
VENDORERRORCODE   8152
SQLSTATE   22001
 

What do i need to do here?
SOLUTION
Avatar of rob_lorentz
rob_lorentz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ianaldo
Ianaldo

Also make sure that you are inserting the correct values into the correct format fields,as in, the value in city should be inserted intoa text field, and since the error is occuring on line 9, there maybe a field there that is being inserted into maybe a number field, also check you relationships in your database!

Hope that Helps!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial