您好,欢迎访问一九零五行业门户网

还是关于悲观锁的问题,begin与commit 之间,可以有多个 fro update语句吗?

是不是可以这样 :
 bgein;
select id from   表1 where id=1  for update;
select id from   表2 where id=1  for update;
select id from   表3 where id=1  for update;
update ok=1 set  表1 where id=1;
update ok=1 set  表2 where id=1;
update ok=1 set  表3 where id=1;
commit ;
回复讨论(解决方案) 是的可以,虽然 update 语句写错了(意思到了)
在此期间,其他的连接是不能 update 这几个表的
是的可以,虽然 update 语句写错了(意思到了)
在此期间,其他的连接是不能 update 这几个表的
多谢版主
其它类似信息

推荐信息