gpt4 book ai didi

java - Teradata jdbcexecuteBatch 抛出奇怪的错误?

转载 作者:行者123 更新时间:2023-12-01 10:19:10 24 4
gpt4 key购买 nike

我使用 jdbc 将原始数据集加载到 Teradata。直到最近我一直在完美工作。

这是代码

    try { 
prst.executeBatch();
}
catch (SQLException ex) {
System.out.println("Batch outside the loop error: ");
while (ex != null)
{
System.out.println(" Error code: " + ex.getErrorCode());
System.out.println(" SQL State: " + ex.getSQLState());
System.out.println(" Message: " + ex.getMessage());
ex.printStackTrace();
System.out.println();
ex = ex.getNextException();
}

}

但是昨天同样的代码抛出了一个错误。这是错误

    [Teradata JDBC Driver] [TeraJDBC 13.00.00.16] [Error 1339] [SQLState HY000] 
A failure occurred while executing a PreparedStatement batch request.
The parameter set was not executed and should be resubmitted
individually using the PreparedStatement executeUpdate method

我使用getNextException()进行了检查,但我得到的只是相同的消息

A failure occurred while executing a PreparedStatement batch request. 
The parameter set was not executed and should be resubmitted
individually using the PreparedStatement executeUpdate method

它再次重复相同的内容,没有任何进一步的细节。我尝试按照建议将批量大小减小到最小值 here但仍然没有结果。

什么可能导致此错误?如何克服呢?

最佳答案

最近遇到了同样的问题:

  1. 如果可以的话,找出导致错误的最小数据子集
  2. 修改代码以选择性地启动而不进行批处理(不用于生产用途)

在我的例子中,它是一个单一的数值,其精度超过了它插入的列,但通常该错误消息隐藏了您遇到的任何问题(字段太大?没有更多的磁盘空间?)

关于java - Teradata jdbcexecuteBatch 抛出奇怪的错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35731117/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com