现在我要写个关于酒店换房的存储过程,需要操作表有openlog开房表,fee消费表,room房间信息
字段有openlog.handleid(手牌号),room.id(标识自动增长的编号),room.handle(房间号),room.state(房间状态)String sqlid="select openlog.handleid from  openlog where handleid in (select room.id from room where handle='"+newroom+"')";//newroom从页面得到新的房间号,根据newroom得到手牌号,并给予下面的sql语句
update openlog set handleid='"+sqlid+"' where handleid=hand";//hand页面穿过来原来的手牌号
update fee set handleid='"+sqlid+"' where handleid=hand;
update room set state=0 where state=1 and handle=hand";
update room set state=1 where state=0 and handle='"+newroom+"' 我这样写对吗?如果可以,
照这样应该需要个in 的参数,具体应该怎样写存储过程呀???