2 qq 27834373 qq_27834373 于 2015.06.23 16:10 提问

sql语句错误,看着晕。

String sql="update userInfo set(NAME=?,EMPCODE=?,DEPTCODE=?,SEX=?,TEL=?,MOBILE=?,STATE=?,USERTYPE=?,ADDRESS=?,POSTALCODE=?,STATION=?,QQ=?) " +
" where userId=?";

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(NAME='é?????',EMPCODE='E0132',DEPTCODE='dept09',SEX=2,TEL='',MOBILE='',STATE=4,' at line 1

3个回答

Tiger_Zhao
Tiger_Zhao   Rxr 2015.06.23 16:17

去掉圆括号。基本语法查下帮助手册,通常有例子的。

strutce
strutce   Ds   Rxr 2015.06.23 16:27

"update userInfo set NAME=?,EMPCODE=?,DEPTCODE=?,SEX=?,TEL=?,MOBILE=?,STATE=?,USERTYPE=?,ADDRESS=?,POSTALCODE=?,STATION=?,QQ=? " +
" where userId=?";

heart_mine
heart_mine   2015.06.23 16:30

String sql = "update userInfo set NAME=?,EMPCODE=?,DEPTCODE=?,SEX=?,TEL=?,MOBILE=?,STATE=?,USERTYPE=?,ADDRESS=?,POSTALCODE=?,STATION=?,QQ=? " +
" where userId=?";

Csdn user default icon
上传中...
上传图片
插入图片