Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: DBMS_SNAPSHOT error...

Re: DBMS_SNAPSHOT error...

From: DA Morgan <damorgan_at_psoug.org>
Date: Fri, 27 Jan 2006 14:24:31 -0800
Message-ID: <1138400667.755130@jetspin.drizzle.com>


Frank van Bortel wrote:

> You cannot commit in a trigger.

Unless that trigger is an autonomous transaction.

The following is valid and useful.

CREATE OR REPLACE TRIGGER pat_demo
BEFORE INSERT
ON person

DECLARE
  PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
    INSERT INTO audit_log
    (chng_when, commentcol)
    VALUES
    (SYSDATE, 'Reporting an error');
    COMMIT;
END pat_demo;
/

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Fri Jan 27 2006 - 16:24:31 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US