[英]Error:com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: by Delete
I have this code: 我有以下代码:
bb.doCammand("delete from models where model_id='" + del + "' OR model_name='" + del + "'");
I received this error: 我收到此错误:
Error:com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: xd model_id and model_name are string.
错误:com.mysql.jdbc.MysqlDataTruncation:数据截断:截断了不正确的DOUBLE值:xd model_id和model_name是字符串。
How can I solve it? 我该如何解决?
Seems like a kind of typo in your query. 您的查询中似乎有错字。
Assuming that del
is a variable of String try to change the query regarding to this showcase: 假设
del
是String的变量,请尝试更改与此展示有关的查询:
"DELETE from models WHERE model_id =" + del + " OR model_name =" + del
It's better to avoid a concatenation at the end of the query. 最好避免在查询结束时进行串联。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.