Toad World® Forums

Enhancement Request - Related child tables


#1

Hi

Sometimes I need to know which tables are, what I call, child tables of the current table.

Basically if there is a table that has a foreign key to the primary or unique of the current table. This is handy if there needs to be a schema change involving the key or I am doing a delete from the parent table and want to see what child information exists but don’t know all the tables.

I can do this via an SQL like

select table_name, constraint_name
from all_constraints
where constraint_type = ‘R’
and r_constraint_name in
(select constraint_name
from all_constraints
where upper(table_name) = upper(:OBJECT_NAME)
and constraint_type IN (‘P’, ‘U’))
order by table_name

where :object_name is the parent table but it would be nice if the IDE provided this sort of information as a dependency or something.

This is not an urgent thing and perhaps not many other people would actually use it, and it might have logic holes in it I don’t see but I thought I would raise it to see if there is any interest.

Regards,
Adrian