这好像应该是在游标定义里用的:cursor c_name is select...for update;
在游标打开时用于update当前选择的记录:update...set...where current of c_name;
c_name 是你定义的游标的名字。
在游标打开时用于update当前选择的记录:update...set...where current of c_name;
c_name 是你定义的游标的名字。
这是Oracle在事务中锁住纪录的方法.
如果不加where条件,那么就是锁住整个表.
同样的,在SQL Server中是:
select … from TableName with (holdlock);
若没有WHERE条件,将很占系统资源,所以锁定的时候最好加WHERE条件。