Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Before Insert Trigger
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
![]() |
![]() |