Re: Before Insert trigger conflict

From: andrewst <member14183_at_dbforums.com>
Date: Wed, 25 Jun 2003 14:58:10 +0000
Message-ID: <3041694.1056553090_at_dbforums.com>


Originally posted by Stephen_ca
> Hi all,
>
> version: Forms 6.0.8.1.9.2
> Oracle 8.1.7.3
> Windows 2000
>
> Our database has some tables where the Primary Key is generated
> through a
> sequence and inserted with a BEFORE INSERT trigger.
>
> My developers are telling me now that when they insert through a form
> that this
> trigger is not functioning correctly, that they're getting a
> "duplicate value on
> primary key" error. They say we have to disable the triggers in the
> database and
> insert the PK value through a forms trigger.
>
> The problem is that inserts to the database will not occur only
> through the forms interface so obviously, without the database
> trigger, the PK value will not be inserted.
> According to one of them, this is a standard forms problem, but I find
> that hard to believe.
>
> Any thoughts are much appreciated and thank you in advance,
>
> Steve
Does not compute. If you can a primary key violation, it is because you tried to insert a PK value that was already there. Doesn't matter whether you created the value in a database trigger or a Forms trigger. The issue appears to be that either there is a bug in your trigger, or the table already has rows with PK values that are higher than the current sequence value. Either way, moving the logic from the database trigger to the form will not help.

--
Posted via http://dbforums.com
Received on Wed Jun 25 2003 - 16:58:10 CEST

Original text of this message