我正在尝试连接到我的数据库并在其上书写
但我有错误
ERROR (com.mirth.connect.connectors.jdbc.DatabaseDispatcher:113): An error occurred in channel "send": Failed to write to database
java.sql.SQLException: String or binary data would be truncated.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671)
at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:613)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:572)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.execute(JtdsPreparedStatement.java:784)
at com.mirth.connect.connectors.jdbc.DatabaseDispatcherQuery.send(DatabaseDispatcherQuery.java:120)
at com.mirth.connect.connectors.jdbc.DatabaseDispatcher.send(DatabaseDispatcher.java:103)
at com.mirth.connect.donkey.server.channel.DestinationConnector.handleSend(DestinationConnector.java:822)
at com.mirth.connect.donkey.server.channel.DestinationConnector.process(DestinationConnector.java:476)
at com.mirth.connect.donkey.server.channel.DestinationChain.doCall(DestinationChain.java:121)
at com.mirth.connect.donkey.server.channel.DestinationChain.call(DestinationChain.java:63)
at com.mirth.connect.donkey.server.channel.Channel.process(Channel.java:1715)
at com.mirth.connect.donkey.server.channel.Channel.dispatchRawMessage(Channel.java:1198)
at com.mirth.connect.donkey.server.channel.SourceConnector.dispatchRawMessage(SourceConnector.java:192)
at com.mirth.connect.donkey.server.channel.SourceConnector.dispatchRawMessage(SourceConnector.java:170)
at com.mirth.connect.connectors.file.FileReceiver.processFile(FileReceiver.java:354)
at com.mirth.connect.connectors.file.FileReceiver.processFiles(FileReceiver.java:247)
at com.mirth.connect.connectors.file.FileReceiver.poll(FileReceiver.java:203)
at com.mirth.connect.donkey.server.channel.PollConnectorJob.execute(PollConnectorJob.java:49)
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
请帮助我!
这是我在sql中的代码:
INSERT INTO Persons ([SurName])
VALUES (${fname})
答案 0 :(得分:0)
您尝试插入的至少一个字符串(或二进制字段)对于数据库中数据类型的大小来说太长了。
使用数据库中相关数据类型的最大大小检查要插入的值的长度。
确保您将值插入到正确的列中,方法是按照您选择的相同顺序指定insert
中的列,或将它们列为值。
答案 1 :(得分:0)