mysql中错误Incorrect DECIMAL value: '0' for column '' at row -1
程序员文章站
2022-07-08 10:52:31
...
功能:转换字符串格式的'-5'为数字参与计算并insert到数据库行
使用cast(d.clazz as decimal(19,4)),select没有问题,加上insert即提示错误:
Error Code: 1366. Incorrect DECIMAL value: '0' for column '' at row -1
换成convert,结果一样,select没问题insert提示错误
网上查一圈,发现:http://www.cnblogs.com/wmcoder/p/5715204.html解决方案二,直接用round处理字符串格式数据,解决此问题。
使用cast(d.clazz as decimal(19,4)),select没有问题,加上insert即提示错误:
Error Code: 1366. Incorrect DECIMAL value: '0' for column '' at row -1
换成convert,结果一样,select没问题insert提示错误
网上查一圈,发现:http://www.cnblogs.com/wmcoder/p/5715204.html解决方案二,直接用round处理字符串格式数据,解决此问题。
推荐阅读
-
ERROR 1366 (HY000): Incorrect string value: '\xE9\x83\x91\xE5\xB7\x9E' for column 'aa' at row 1 MySQL 字符集
-
mysql报错:java.sql.SQLException: Incorrect string value: '\xE4\xB8\x80\xE6\xAC\xA1...' for column 'excelName' at row 1
-
mysql中错误Incorrect DECIMAL value: '0' for column '' at row -1
-
mysql中错误Incorrect DECIMAL value: '0' for column '' at row -1
-
java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x8E' for column 'name' at row 1
-
MySql 中文写入数据库乱码及Incorrect string value: '\xF0\x9F...' for column 'XXX' at row 1解决
-
mysql提示:Incorrect integer value: for column id at row 1报
-
在用mybatis向MySQL数据库中插入时间时报错:Incorrect datetime value: '' for column '' at row 1
-
Incorrect integer value: ''for column 'id' at row 1解决_MySQL
-
Incorrect integer value: ''for column 'id' at row 1解决_MySQL