org.hibernate.hql.ast.QuerySyntaxException: unexpected token: 89 near line 1, column 72
[update com.lansone.btrankline.entity.Users u set u.userCardnum = 00000089 where u.userMobilephone = 13906110017]
传入的参数为00000089 时,报这个错误,就是参数不能以0开头,
传入不以0为开头的数字是正确执行的
修改SQL语句如下
String hql="update Users u set u.userCardnum = to_char('"+newCard+"') where u.userMobilephone = "+userMobilephone;
或者
String hql="update Users u set u.userCardnum = :newCard where u.userMobilephone = :userMobilephone";
-------
[update com.lansone.btrankline.entity.Users u set u.userCardnum = 00000089 where u.userMobilephone = 13906110017]
传入的参数为00000089 时,报这个错误,就是参数不能以0开头,
传入不以0为开头的数字是正确执行的
修改SQL语句如下
String hql="update Users u set u.userCardnum = to_char('"+newCard+"') where u.userMobilephone = "+userMobilephone;
或者
String hql="update Users u set u.userCardnum = :newCard where u.userMobilephone = :userMobilephone";
-------