A Parent table has a entry say "Business group Id (1000)" in
This entry(1000) can be referenced by so many tables as a foreign key
using referential integrity. Say TFNumber Table, VPN Table, AC
When I try to delete the entry (1000) two things can happen.
a> If none of the table refering this entry it will be deleted.
b> If atleast one table (TFNumber, AC, ...) is refering this entry
then error will be issued.
I can Schedule (eg: After 10 days) this entry (1000) for delete. So
the system will throw an error only when it tries to delete the entry.
Ideally I will be getting this error only after 10 days.
The requirement is, even in case of Schedule the system should check
if any of the entries in VPN, AC, TFNumber,.... is refering
BussinessGroup entry (1000) if so issue an error. else go ahead and
schdule it for delete.
The same logic needs to be applied to all other
Master-Slave/Parent-Child tables. I have lots of Parent-child table,
so it is difficult to find out who are all master and who are all
child and so on.
Another thing is that int the above example Business group is a
master/parent and VPN,AC,TFNUmber.. all are child. For an another
scenario this child (VPN/TFNumber/AC/..) will be a master and it will
be having set of other tables (Timer,AcSet,..) as a child.. The
relation would be
Business group ....
| | | |.. | | |..
TFN AC VPN .. ......
| | | |
| | |
Tim AcS ..
So I would like to know using an Referential Integrity is there a way
to find out "Are there any child refering this parent(1000)"?. So that
I will apply this logic to all the parent/MAster.