【单条记录锁】select single for update

示例:spa

DATA: wa_t001 type t001.博客

select single for update * into wa_t001 from t001 where bukrs = '1000'.it

 

解释:date

select single for update,where条件必须涵盖全部主键。select

执行时,该语句会锁定知足条件的单条数据(在SM12中是看不到的)。数据

锁定退出条件:执行到commit或rollback。co

补充:commit

若是有其余的select single for update访问到一样的数据,会一直等待直到被锁定的记录解锁。文章

 

----------------------------------------------

本博客全部原创文章,未经博主容许,请勿转载。

----------------------------------------------

相关文章
相关标签/搜索