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

Home -> Community -> Usenet -> c.d.o.tools -> Triggers Newbie

Triggers Newbie

From: Susan Entwisle <sentwisle_at_ozemail.com.au>
Date: Sun, 1 Oct 2000 12:09:22 +1000
Message-ID: <xawB5.14216$O7.192119@ozemail.com.au>

Hi,

I am writing my first trigger and I have a problem with the exception clause (see below) , what I would like to do in the event of an exception write to a log table and inform the user. When this exception handler is executed the RAISE_APPLICATION_ERROR message is being displayed but there is no record being inserted into the log_info table. I believe this is occurring because the RAISE_APPLICATION_ERROR is causing the rollback to occur to the log_info table. As I cannot directly use the COMMIT statement (nor would I want to commit) in a trigger is there any other way that I can perform both of these tasks.

Thanking you in advance.

Cheers
Susan

EXCEPTION WHEN e_TimesEqual THEN
 /* Handler for when the commence times and end time are equal */  INSERT INTO log_info (time_logged, machine_logged, code_id, info)  VALUES (v_CurrentTimeDate, v_Terminal, -20000, 'Invalid Commence Time and End Time Equal for Packer' || :new.packer_id || 'from ' || :new.commence_time || ' to ' || :new.end_time );  RAISE_APPLICATION_ERROR(-20000, 'Invalid Commence Time and End Time Equal'); Received on Sat Sep 30 2000 - 21:09:22 CDT

Original text of this message

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