oracle-for update 与 for update of
来源:互联网 发布:dnf双开网络中断 编辑:程序博客网 时间:2024/05/29 02:22
本文转载自:http://blog.csdn.net/indieinside/article/details/13296695
1 select * from TTable1 for update 锁定表的所有行,只能读不能写
2 select * from TTable1 where pkid = 1 for update 只锁定pkid=1的行
3 select * from Table1 a join Table2 b on a.pkid=b.pkid for update 锁定两个表的所有记录
4 select * from Table1 a join Table2 b on a.pkid=b.pkid where a.pkid = 10 for update 锁定两个表的中满足条件的行
5. select * from Table1 a join Table2 b on a.pkid=b.pkid where a.pkid = 10 for update of a.pkid 只锁定Table1中满足条件的行
for update 是把所有的表都锁点 for update of 根据of 后表的条件锁定相对应的表
select * from emp where empno = 7369 for update; 会对表中员工编号为7369的记录进行上锁。其他用户无法对该记录进行操作,只能查询。select * from emp where empno = 7369 for update of sal; 这条语句是不是意味着只对表中的7369 这一行的sal字段的数据进行了上锁,其他数据则可以被其他用户做更新操作呢。学员测试结果为二条语句的效果是一样的。
在对多个表进行锁定时for update of才会起作用,用户1进行如下操作(of 后面可以使table1中任意字段):
select * from table1 a, table2 b where a.filed1 = b.filed1
for update of a.filed1 ;
用户2进行如下操作时可以对table2进行锁定,因为用户1只对table1进行了锁定:
select * from table2 b
for update
- oracle-for update 与 for update of
- oracle-for update 与 for update of
- oracle 中 for update与for update of的区别
- ORACLE FOR UPDATE与FOR UPDATE OF区别
- For Update 与 For Update of 区别
- for update of 与for update 不同之处
- 数据库oracle for update of 和for update的区别
- 数据库 oracle for update of 和 for update区别
- Oracle数据库:for update 和for update of
- 数据库oracle for update of和for update区别
- 数据库 oracle for update of 和 for update区别【经典】
- 数据库 oracle for update of 和 for update区别【经典】
- 数据库 oracle for update of 和 for update区别
- 数据库 oracle for update of 和 for update区别
- oracle for update 和 for update of的区别
- 数据库oracle for update of和for update区别
- 数据库 oracle for update of 和 for update区别【经典】
- 数据库oracle for update of和for update区别
- 掌握pua语言,实施舞步学院聊天+约会攻略,架构异性吸引力
- C++学习笔记13:类继承和派生、虚函数
- Java加密Jar包和Class文件防止反编译的方法
- python 多进程 get
- Android系统进程的内存管理分析
- oracle-for update 与 for update of
- java基础教程:面向对象编程之封装(14)
- Manifest merger failed with multiple errors, see logs
- jQuery Mobile 方向改变事件
- ionic开发——百度地图InfoWindow信息窗口上添加按钮,无法触发点击事件问题解决办法
- JQuery 给h和span标签赋值和取值
- Mysql开启慢查询
- Hamming Embedding 汉明嵌入简介
- 学Python的目的