当我尝试使用本机SQL更新数据时出现此错误。这是我的脚本:休眠:无法执行本地批量操作查询
update weight_note_receipt set pledge_id =:pledge where wn_id in (:wns)
wns
是包含字符串超过1 wn_id
这样的:
222,226,228,251,256,262,263,264,265,266,267,272,281,286,294,296,299,301,302,303,306,307,330,332,333,337,338,339,341,368,371,376,377,378,379,380,381,385,391,397,423,424,443,452,454,461,462,463,464,490,503,504,521,525,528,529,530,532,533,549,554,560,561,564,565,566,567,569,570,595,598,600,603,605,606,607,644,646,649,653,661,662,663,667,669,678,683,752,1039,1075,258,259,260,261,268,269,270,287,304,305,308,325,334,604,643,647,648,659,660,664,665,666,704,709,753,754,757,758,809,834,846,861,872,879,882,911,913,916,919,920,164
当我更新(用query.executeUpdate()
),它引发以下错误:
Request processing failed; nested exception is org.hibernate.exception.DataException: could not execute native bulk manipulation query] with root cause com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: '222,226,228,251,256,262,263,264,265,266,267,272,281,286,294,296,299,301,302,303,306,307,330,332,333,337,338,339,341,368,371,376,'
是否因为输入字符串太长?
我还是不明白,但你的解决方案运行良好,非常感谢 –
剩下的问题是什么? –
现在,我明白了,非常感谢 –