The pragma is valid in a packaged procedure. : Transaction « PL SQL « Oracle PL / SQL






The pragma is valid in a packaged procedure.

 
SQL>
SQL>
SQL> CREATE OR REPLACE PACKAGE Auto2 AS
  2    PROCEDURE P;
  3  END Auto2;
  4  /

Package created.

SQL> show errors
No errors.
SQL>
SQL> CREATE OR REPLACE PACKAGE BODY Auto2 AS
  2    PROCEDURE P IS
  3      PRAGMA AUTONOMOUS_TRANSACTION;
  4    BEGIN
  5      COMMIT;
  6    END P;
  7  END Auto2;
  8  /

Package body created.

SQL> show errors
No errors.
SQL>

 








Related examples in the same category

1.Commit an insert statement in PL SQL
2.set transaction use rollback segment
3.The pragma is legal in top-level anonymous blocks:
4.The pragma is not legal in nested blocks:
5.The pragma is valid in both standalone and local subprograms.
6.interaction between savepoints and autonomous transactions.
7.Calling an autonomous function from SQL.
8.Autonomous transactions.