Com. microsoft. sqlserver. jdbc. SQLServerException: Truncated characters

Source: Internet
Author: User
Exception com. microsoft. sqlserver. jdbc. SQLServerException: The exception information for truncating string or binary data is as follows: Causedby: com. microsoft. sqlserver. jdbc. SQLServerException: truncates string or binary data. Atcom

An exception occurred while exchanging data from Oracle to the SQL Server intermediate database. microsoft. sqlserver. jdbc. SQLServerException: The exception information for truncating string or binary data is as follows: Caused by: com. microsoft. sqlserver. jdbc. SQLServerException: truncates string or binary data. At com

An exception occurred while exchanging data from Oracle to the SQL Server intermediate database.

Com. microsoft. sqlserver. jdbc. SQLServerException: truncates string or binary data.

The exception information is as follows:

Caused:

Com. microsoft. sqlserver. jdbc. SQLServerException: truncates string or binary data.
At com. microsoft. sqlserver. jdbc. SQLServerException. makeFromDatabaseError (SQLServerException. java: 216)
At com. microsoft. sqlserver. jdbc. SQLServerStatement. getNextResult (SQLServerStatement. java: 1515)
At com. microsoft. sqlserver. jdbc. SQLServerPreparedStatement. doExecutePreparedStatement (SQLServerPreparedStatement. java: 404)
At com. microsoft. sqlserver. jdbc. SQLServerPreparedStatement $ prep;texeccmd. doExecute (SQLServerPreparedStatement. java: 350)
At com.microsoft.sqlserver.jdbc.TDSCommand.exe cute (IOBuffer. java: 5696)
At com.microsoft.sqlserver.jdbc.SQLServerConnection.exe cuteCommand (SQLServerConnection. java: 1715)
At com.microsoft.sqlserver.jdbc.SQLServerStatement.exe cuteCommand (SQLServerStatement. java: 180)
At com.microsoft.sqlserver.jdbc.SQLServerStatement.exe cuteStatement (SQLServerStatement. java: 155)
At com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.exe cuteUpdate (SQLServerPreparedStatement. java: 314)
At com. ibm. ws. rsadapter. jdbc. WSJdbcPreparedStatement. pmiExecuteUpdate (WSJdbcPreparedStatement. java: 1104)
At com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.exe cuteUpdate (WSJdbcPreparedStatement. java: 771)

... 11 more


I searched for it on the internet for several reasons, which may cause this exception.

Http://www.cnblogs.com/lingy/archive/2012/09/14/2684491.html

Insufficient Field Length


Http://bbs.csdn.net/topics/330076495

Trigger processing business logic



This problem occurs when the field length is insufficient. The length defined in SQL Server is 24, and the length defined in Oracle is 50. Modify the field length. The problem is solved.


The SQL statement for determining the length is as follows:Meal certificate 20112101230000159"

SQL statements queried in SQL Server

Select len ('meal certificate 20112101230000159 '), datalength ('meal certificate 20112101230000159 ');

The length is 21 and 25 bytes are occupied.


SQL statements queried in Oracle

Select length ('meal certificate 20112101230000159 '), lengthb ('meal certificate 20112101230000159') from dual;

The length is 21 and 25 bytes are occupied.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.