sql = "insert into borrow (conferenceid,reason,borrowremark,operator,borrowdate,starttime,endtime,borrower,operatortime) values ("+id+",'"+ keys[0] +"','"+keys[2]+"','"+keys[3]+"','"+keys[4] +"','"+ keys[5]+"','"+keys[6]+"','"+keys[1]+"','"+operatortime+"')";
sql +=" update borrow b set b.conferencenumber = c.conferencenumber,b.conferencename = c.conferencename,b.campusname = c.campusname,b.cenferencecontent = c.cenferencecontent,b.buildingname = c.buildingname,b.conferencetype = c.conferencetype,b.remark = c.remark,b.collegeallot = c.collegeallot,b.floor = c.floor form conference c where '"+id+"' = c.id ";
上面代码出错:com.microsoft.sqlserver.jdbc.SQLServerException: 'b' 附近有语法错误。
上面基本就是先存了一些数据,在根据id把一张表的数据更新到另一张表里。数据库是sql server
习惯受伤
相关分类