OnLine error 742
Posted in 1997
Topics: Stored Procedures & SPL, Server Administration, Triggers, Constraints & Referential Integrity
Hello all,
I was wondering if someone out there might have a work around for a
problem I am having with triggers and cascading delete errors. If I
understand the message(742) correctly, I am not allowed to create a
delete database trigger on a table that was created with a ON DELETE
CASCADE clause.
Is this correct? I am trying to figure out a way around this problem.
I need to delete rows from a non-referenced table (I use to store errors
about certain fields in) when the "parent" row gets wiped out of the
ON DELETE CASCADE table (this is a child table, of course). Here's the
relation :
Parent:
link_id integer
row1 integer
rowx char (etc)
Child:
link_id integer
recid1 integer
rowm char
rowz char
FK link_id references parent
ON DELETE CASCADE
Error_table:
link_id integer
recid1 integer
error_name char
Trigger for Child:
trigger del_trg
delete of child
execute procedure wipe_error(link_id,recid1);
Procedure:
create procedure wipe_error(link_id_in int, recid1_in int)
delete from error_table
where link_id = link_id_in
and recid1 = recid1_in;
try to compile :
742: Trigger and referential constraint cannot co-exist.
Any suggestions?
Thanks in advance,
Joe K
dba ORACLE, INFORMIX, SYBASE
Sigma Systems Technologies