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 -> Before Insert Trigger

Before Insert Trigger

From: <dbaplusplus_at_hotmail.com>
Date: 27 Sep 2005 16:17:24 -0700
Message-ID: <1127863044.655753.185680@g47g2000cwa.googlegroups.com>

I have a table test. I have set up a trigger (before insert)

CREATE OR REPLACE TRIGGER tr_test_row
BEFORE INSERT ON test
FOR EACH ROW There is a primary key on table test on name column. There is already a row in test table.

When I insert a row with same name as an existing row, Oracle does not fire the trigger (I have put debugging statements in the trigger) instead it immediately sends me a message that unique constraint violated. Why? I was expecting that the uniqueness check will be done after trigger is fired (it is a before insert trigger). I have error catching logic in my trigger and want to capture all Oracle errors including unique constraint violation in the trigger. Is there a way of doing that?

Any pointers will be appreciated. Thanks a lot. Received on Tue Sep 27 2005 - 18:17:24 CDT

Original text of this message

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