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: david wendelken <davewendelken_at_earthlink.net>
Date: Wed, 18 May 2005 09:24:54 -0700 (PDT)
Message-ID: <23277425.1116433494211.JavaMail.root@bert.psp.pas.earthlink.net>

>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
Received on Wed May 18 2005 - 12:30:58 CDT

Original text of this message

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