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

Home -> Community -> Usenet -> c.d.o.misc -> Re: database triggers!

Re: database triggers!

From: <yewpc_at_my-dejanews.com>
Date: Fri, 20 Nov 1998 02:16:13 GMT
Message-ID: <732jd1$hhv$1@nnrp1.dejanews.com>


The reason is changes to the master table and history table will be in one transaction (same commit point because of the trigger). By having a foreign key between this 2 tables, the manipulation of the data in history table will cause ORACLE to enforce the foreign key with refer to master table that is being update in the same transaction, thus it cause error. This is what I understand. In article <72qonn$mqt$1_at_nnrp1.dejanews.com>, janakah_at_my-dejanews.com wrote:

> I got two tables called file_volumes(master) and file_history( details) and a
> foreign key is specified on file_history table. I wrote a simple database
> trigger based on file_volumes table to insert a new record into file_history
> whenever file_volumes is updated. Then with the trigger enabled when I try to
> update file_volumes I got an error ORA-04091 - name is mutating, trigger may
> not read or modify it
>
> I drop the foreign key constraint on the file_history table and then the
> trigger works without any errors.
>
> Can someone explain to me the problem caused by the foreign key constraint ?
>
> Thanks in advance
>
> Janaka
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Nov 19 1998 - 20:16:13 CST

Original text of this message

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