问题描述
当我们使用达梦数据库执行SQL语句时,可能会遇到如下报错:
dm.jdbc.driver.DMException: 字符串截断
at dm.jdbc.driver.DBError.throwException(DBError.java:698) ~[DmJdbcDriver18.jar:- 8.1.2.138 - Production]
at dm.jdbc.b.b.o.E(MSG.java:564) ~[DmJdbcDriver18.jar:- 8.1.2.138 - Production]
at dm.jdbc.b.b.o.B(MSG.java:520) ~[DmJdbcDriver18.jar:- 8.1.2.138 - Production]
at dm.jdbc.b.b.o.A(MSG.java:501) ~[DmJdbcDriver18.jar:- 8.1.2.138 - Production]
at dm.jdbc.b.a.a(DBAccess.java:244) ~[DmJdbcDriver18.jar:- 8.1.2.138 - Production]
at dm.jdbc.b.a.b(DBAccess.java:922) ~[DmJdbcDriver18.jar:- 8.1.2.138 - Production]
at dm.jdbc.b.a.a(DBAccess.java:793) ~[DmJdbcDriver18.jar:- 8.1.2.138 - Production]
问题分析
这种情况常常发生在我们执行这类SQL时
Insert into table1 ( select XX , XXX from table2 );
导致这种问题的原因,就是 表tabl