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 -> updating a referencing field via trigger

updating a referencing field via trigger

From: Thomas Bierhance <Bierhance_at_orbital-computer.de>
Date: Sat, 29 May 1999 13:51:28 +0200
Message-ID: <374FD4C0.528F0520@orbital-computer.de>


Hi,

I'm having a problem in following situation. There is a table 'A' that references another table 'B'. When deleting a row in table 'B' I want the reference in table 'A' set to NULL. I created a trigger for that:

before delete on B for each row
begin

    update

        A
    set

        A_B_ID = null
    where

        A_B_ID = :old.B_ID;
end;

But it does not work as oracle says that i can't update this reference when changes (deleting) are applied to the referenced table.

Any suggestions?

Thanks

Thomas Bierhance Received on Sat May 29 1999 - 06:51:28 CDT

Original text of this message

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