oracle-for update 与 for update of
来源:互联网 发布:linux设置自启命令 编辑:程序博客网 时间:2024/06/08 23:13
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区别
- do...while(0)的妙用
- 使用JAXP进行SAX解析(XMLReaderFactory、XMLReader 、SAXParserFactory与SAXParser)
- jquery 返回上级 parent、parents和parentsUntil
- web.xml 中的listener、 filter、servlet 加载顺序及其详解
- Python socket编程
- oracle-for update 与 for update of
- Windows Phone - 引用图片资源的方式可能会影响图片显示质量
- mktemp
- Android 2.1 源码目录结构
- 关于正则表达式
- AChartEngine实现Android实时曲线绘制
- swing编写client端及多线程server端之server端
- 寻找第K大的数的方法总结
- LinkedList实现队列和栈