当前位置: 技术问答>java相关
插入数据库行删除不行哪位给解释一下
来源: 互联网 发布时间:2015-06-15
本文导语: String sqlinsert; sqlinsert="insert into register(logname) VALUES('a')"; stmt.execute(sqlinsert); 把sqlinsert改为: sqlinsert="delete from register where logname='a'"; 提示错误:javax.servlet.ServletException: [Microsoft][ODBC SQL Server Driver][SQL Server]The t...
String sqlinsert;
sqlinsert="insert into register(logname) VALUES('a')";
stmt.execute(sqlinsert);
把sqlinsert改为:
sqlinsert="delete from register where logname='a'";
提示错误:javax.servlet.ServletException: [Microsoft][ODBC SQL Server Driver][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
logname数据为text型
sqlinsert="insert into register(logname) VALUES('a')";
stmt.execute(sqlinsert);
把sqlinsert改为:
sqlinsert="delete from register where logname='a'";
提示错误:javax.servlet.ServletException: [Microsoft][ODBC SQL Server Driver][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
logname数据为text型
|
题是不是说了很清楚吗?text cannot be compared ;
logname数据为text型
你可以用like
delete register where logname like 'a'
logname数据为text型
你可以用like
delete register where logname like 'a'