Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: TRIGGERS
Oops,
> Um... The pre-insert trigger fires before the insert actually occurs
- so > it won't get the exception. The exception would be caused after
the pre-> > insert trigger is finished. Right?
David, you are right.
Igor Neyman, OCP DBA
ineyman_at_perceptron.com
-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of david wendelken
Sent: Wednesday, May 18, 2005 11:25 AM
To: oracle-l_at_freelists.org
Subject: RE: TRIGGERS
>Handle DUP_VAL_ON_INDEX exception in your trigger and loop (get
>sequence.NEXTVAL) untill there is no exception.
Um... The pre-insert trigger fires before the insert actually occurs - so it won't get the exception. The exception would be caused after the pre-insert trigger is finished. Right?
The pre-insert trigger can't check the table directly to see if it would work, because it will get a mutating-table error.
Autonomous transactions might get around the mutating table problem, but multi-user environments could still cause the error to occur. (Not all that likely, but possible.)
>BUT,
>The bigger question: is there a valid "business" reason to allow
>"manually created" IDs when you have a sequnce to generate those? I
>think, the problem is in your design.
Yep. Exactly right.
-- http://www.freelists.org/webpage/oracle-l -- http://www.freelists.org/webpage/oracle-lReceived on Wed May 18 2005 - 12:49:00 CDT
![]() |
![]() |