示例:

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访问到同样的数据,会一直等待直到被锁定的记录解锁。

 

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

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

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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-25
  • 2021-10-01
  • 2022-02-27
  • 2021-08-14
  • 2023-01-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-03-06
  • 2022-03-04
  • 2021-10-05
  • 2022-01-03
  • 2022-12-23
相关资源
相似解决方案