Home  >  Article  >  Database  >  Oracle PLSQL之cursor取得是open时的数据

Oracle PLSQL之cursor取得是open时的数据

WBOY
WBOYOriginal
2016-06-07 17:06:331023browse

当我们定义了一个很复杂的cursor,这个cursor需要执行很长时间,在这个cursor执行的过程中,其它用户又修改了该cursor所引用的表

当我们定义了一个很复杂的cursor,这个cursor需要执行很长时间,,在这个cursor执行的过程中,其它用户又修改了该cursor所引用的表的数据时,cursor得到的是修改前还是修改后的数据呢? 

答案是cursor得到的始终是cursor在open时的数据,接下来我们将通过一个小实验来验证。

首先,session1执行以下匿名块,该匿名块通过cursor取得t1表的所有数据,不过在open cursor后将暂停30秒,在这30秒中我们将在session2中删除t1表的所有数据: 

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn