Re: Trigger Problem.

From: JamesF5088 <jamesf5088_at_aol.com>
Date: 13 Dec 1994 20:55:20 -0500
Message-ID: <3clja8$56i_at_newsbf01.news.aol.com>


In article <3ckvvi$ait_at_master.di.fc.ul.pt>, barreto_at_master.di.fc.ul.pt (Joao Barreto Fernandes) writes:

> I have a table where I let other people insert and update ( this
 is
>done under a course in database systems - it is only meaningful if
 thinking
>it as pedagogical) rows. Nevertheless I want to use the same table as a
 place
>where i account their moves. i.e. for each insert, update or delete
 people do
>I insert "another" row using certain fields to indicate theis action. If
 this
>makes sense doesn't matter. What matters is that Oracle doesn't let me
 insert
>another row than the one that triggered the trigger. It says that the
 table is
>mutating.

*You should be able to write PRE and POST triggers such as: for PRE-INSERT, PRE-UPDATE, and PRE-DELETE

    :global.keyfield := :block.keyfield_being_inserted_updated_or_deleted;

for POST-INSERT, POST-UPDATE, and POST-DELETE

   insert into table1
   (keyfield1, field2, field3) values
   (:global.keyfield, value2, value3);

*NOTE: This assumes that keyfield IS NOT a unique key.

Good Luck
Jim Received on Wed Dec 14 1994 - 02:55:20 CET

Original text of this message