Autonomous PL/SQL Blocks (151)
You can call autonomous transactions from within a PL/SQL block. Use the pragma
AUTONOMOUS_TRANSACTION. A pragma is a compiler directive. You can declare the
following kinds of PL/SQL blocks to be autonomous:
■ Stored procedure or function
■ Local procedure or function
■ Package
■ Type method
■ Top-level anonymous block
When an autonomous PL/SQL block is entered, the transaction context of the caller is
suspended. This operation ensures that SQL operations performed in this block (or
other blocks called from it) have no dependence or effect on the state of the caller’s
transaction context.
When an autonomous block invokes another autonomous block or itself, the called
block does not share any transaction context with the calling block. However, when an
autonomous block invokes a non-autonomous block (that is, one that is not declared to
be autonomous), the called block inherits the transaction context of the calling
autonomous block.
自治事務pl/sql塊
1. 在pl/sql塊中可以使用pragma(編譯器指令) AUTONOMOUS_TRANSACTION 來呼叫自治事務
2. 以下型別的pl/sql塊可為自治事務 : 儲存過程或者函式(包括本地) , 包 , 型別方法 , 頂級匿名塊
3. 當一個自治的塊程式結構開始執行時,呼叫者的事務上下文環境就被掛起.這保證了自治事務塊
(或由此自治事務塊呼叫的其他結構)內的 SQL 操作與呼叫者的事務上下文環境相獨立
4. 當一個自治事務塊呼叫其他自治事務塊或其自身時,被呼叫的不會與呼叫者共享任何事務上下文環境.
但當一個自治事務塊呼叫一個非自治事務塊時,被呼叫的程式結構將繼承呼叫者的事務上下文環境.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10599713/viewspace-980975/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Named vs Anonymous Pl/sql Blocks testingSQLBloC
- PL/SQLSQL
- SQL&PL/SQL (轉)SQL
- PL/SQL 宣告SQL
- PL/SQL cursorSQL
- PL/SQL打包SQL
- PL/SQL DEVSQLdev
- 使用PL/Scope分析PL/SQL程式碼SQL
- PLSQL Language Reference-PL/SQL概覽-PL/SQL架構SQL架構
- [PL/SQL]10g PL/SQL學習筆記(一)SQL筆記
- [PL/SQL]10g PL/SQL學習筆記(二)SQL筆記
- [PL/SQL]10g PL/SQL學習筆記(三)SQL筆記
- PL/SQL 迴圈SQL
- PL/SQL 遊標SQL
- PL/SQL 運算子SQL
- PL/SQL 條件SQL
- pl/sql to_dateSQL
- PL/SQL 基礎SQL
- Oracle PL/SQL INDICESOracleSQL
- PL/SQl Developer使用SQLDeveloper
- pl/sql陣列SQL陣列
- pl/sql練習SQL
- oracle PL/SQL示例OracleSQL
- 淺談pl/sqlSQL
- PL/SQL 索引表SQL索引
- pl/sql 練習SQL
- [pl sql] where current ofSQL
- pl/sql功能特性SQL
- PL/SQL Developer 使用SQLDeveloper
- PL/SQL小結SQL
- steven's pl/sqlSQL
- PL/SQL入門SQL
- PL/SQL 設定SQL
- PLSQL Language Reference-PL/SQL概覽-PL/SQL的優點SQL
- Oracle PL/SQL編寫PL/SQL程式碼的注意事項OracleSQL
- ONLine SQL and PL/SQL FormatterSQLORM
- PL/SQL執行動態SQLSQL
- PLSQL Language Reference-PL/SQL概覽-PL/SQL語言基礎SQL