Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Which one is better? Oracel 9i or DB2 7.2??
The Nomad wrote:
> A side note - I found the information on the mutating table by searching for
> the Error I received in the Oracle documentation. Here is where it took me:
>
> http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/appdev.817/
> a76939/adg13trg.htm#786
>
> I just searched the documentation of this error/issue, and it doesn't
> mention your PRAGMA solution.
>
> Marc
At times, you may want to commit or roll back some changes to a table independently of a primary transaction's final outcome. For example, in a stock purchase transaction, you may want to commit a customer's information regardless of whether the overall stock purchase actually goes through. Or, while running that same transaction, you may want to log error messages to a debug table even if the overall transaction rolls back. Autonomous transactions allow you to do such tasks.
An autonomous transaction (AT) is an independent transaction started by another transaction, the main transaction (MT). It lets you suspend the main transaction, do SQL operations, commit, or roll back those operations, then resume the main transaction.
An autonomous transaction executes within an autonomous scope. An autonomous scope is a routine you mark with the pragma (compiler directive) AUTONOMOUS_TRANSACTION. The pragma instructs the PL/SQL compiler to mark a routine as autonomous (independent). In this context, the term routine includes:
Top-level (not nested) anonymous PL/SQL blocks
Local, stand-alone, and packaged functions and procedures
Methods of a SQL object type
PL/SQL triggers
Source:
http://technet.oracle.com/doc/oracle8i_816/appdev.816/a76939/adg08sql.htm#8266
Daniel Morgan Received on Fri May 03 2002 - 14:23:44 CDT