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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: TRIGGERS

RE: TRIGGERS

From: Igor Neyman <ineyman_at_perceptron.com>
Date: Wed, 18 May 2005 12:44:11 -0400
Message-ID: <001b01c55bc8$d16410b0$2004a8c0@development.perceptron.com>


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-l
Received on Wed May 18 2005 - 12:49:00 CDT

Original text of this message

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