Subject | row reference count |
---|---|
Author | Gediminas |
Post date | 2003-11-18T12:00:05Z |
how to check, is row referenced in other tables via FK? I have
master-detail relation, so when I delete detail row, master row is
deleted also (set cascade on). In most cases this is ok, but sometimes
need to check, is any reference to erasable row - some tables may be
locked for changes, so cascading delete would destroy important data
Another question:
if I execute such delete code:
delete from table where "Name"="John";
how in trigger to check, that matching row (say, that PK is "Row_ID"
column) is referenced in other tables via FK?
Gediminas
-/ The Truth Is Out There /-
master-detail relation, so when I delete detail row, master row is
deleted also (set cascade on). In most cases this is ok, but sometimes
need to check, is any reference to erasable row - some tables may be
locked for changes, so cascading delete would destroy important data
Another question:
if I execute such delete code:
delete from table where "Name"="John";
how in trigger to check, that matching row (say, that PK is "Row_ID"
column) is referenced in other tables via FK?
Gediminas
-/ The Truth Is Out There /-