Mark an anonymous block 'pragma autonomous_transaction' : Autonomous Transaction « PL SQL Statements « Oracle PL/SQL Tutorial






SQL>
SQL> create or replace package global_variables
  2  as
  3      x number;
  4  end;
  5  /

Package created.

SQL>
SQL> begin
  2      global_variables.x := 5;
  3  end;
  4  /

PL/SQL procedure successfully completed.

SQL>
SQL> declare
  2      pragma autonomous_transaction;
  3  begin
  4      global_variables.x := 10;
  5      commit;
  6  end;
  7  /

PL/SQL procedure successfully completed.

SQL>
SQL> set serveroutput on
SQL> exec dbms_output.put_line( global_variables.x );
10

PL/SQL procedure successfully completed.

SQL>
SQL>








22.21.Autonomous Transaction
22.21.1.Autonomous Transactions
22.21.2.Audit as Autonomous Transaction
22.21.3.Non-Working p_log_audit
22.21.4.Mark an anonymous block 'pragma autonomous_transaction'
22.21.5.'pragma autonomous_transaction' package member procedure
22.21.6.Commit an Insert statement in a 'pragma autonomous_transaction' procedure