码迷,mamicode.com
首页 > 其他好文 > 详细

【单条记录锁】select single for update

时间:2015-12-02 11:59:25      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:

DATA: wa_t001 type t001.

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

 

解释:

select single for update,where条件必须涵盖所有主键。

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

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

补充:

如果有其他的select single for update访问到同样的数据,会一直等待直到被锁定的记录解锁。

 

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

本博客所有原创文章,未经博主允许,请勿转载。

【单条记录锁】select single for update

标签:

原文地址:http://www.cnblogs.com/abap-ll/p/5012287.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!