0
當我嘗試在netezza上執行executeBatch()時,會出現錯誤。以下是錯誤:無法在Netezza上執行executeBatch() - JDBC
org.netezza.error.NzSQLException:ERROR:更新已取消:嘗試從多個值更新目標行加入行..
請看看下面的代碼:
String updateDim = "UPDATE DIM_DETAILS set c1 = ? where rep_id = 185 and ar_id = ? and pe_id = ? and se_id = ? and by_id = ?";
stmt3 = conn.prepareStatement(updateDim);
for (Dim dim : updatedDimList){
upcount += 1;
opvalue = BeanUtils.getProperty(dim, dimName.toLowerCase());
stmt3.setString(1, opvalue);
stmt3.setString(2, dim.getAr_id());
stmt3.setString(3, dim.getPe_id());
stmt3.setString(4, dim.getSe_id());
stmt3.setString(5, dim.getBy_id());
stmt3.addBatch();
//stmt3.executeUpdate();
//System.out.println("Successfully Updated Rows: "+upcount);
}
int[] recordsAffected = stmt3.executeBatch();
conn.commit();