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.