Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> updating a referencing field via trigger
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 - 09:45:36 CDT
![]() |
![]() |