HELP: Mutating Tables
From: Alistair mackay <eddie_at_tag.co.uk>
Date: 1996/08/02
Message-ID: <598504418wnr_at_tag.co.uk>#1/1
Date: 1996/08/02
Message-ID: <598504418wnr_at_tag.co.uk>#1/1
Consider
CREATE TRIGGER detail_set_null AFTER DELETE ON master
REFERENCING OLD AS deleted
FOR EACH ROW
BEGIN
UPDATE detail SET
detail.foreignkey = NULL
WHERE detail.foreignkey = :deleted.primarykey;
END
If I create the trigger as AFTER DELETE, I get an RI error from Oracle
telling me that dependant detail rows exist.
If I create the trigger as BEFORE DELETE, I get a mutating table
exception on master.
TIA.
-- ------------------------------------------------------------------------Received on Fri Aug 02 1996 - 00:00:00 CEST
| A. Mackay EMail eddie_at_tag.co.uk |
| http://www.tag.co.uk/tag/ |
| Technology Applications Group |
| |
| Comments are my own and do not reflect the policies of the company I |
| work for. No responsiblitly accepted for incorrect advice given. |
------------------------------------------------------------------------