當我嘗試使用本機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,'
是否因爲輸入字符串太長?
我還是不明白,但你的解決方案運行良好,非常感謝 –
剩下的問題是什麼? –
現在,我明白了,非常感謝 –