RE: TRIGGERS

  • From: david wendelken <davewendelken@xxxxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Wed, 18 May 2005 09:24:54 -0700 (PDT)

>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.

--
//www.freelists.org/webpage/oracle-l

Other related posts: