child table and parent tables
Up to DB2child table and parent tables
Posted by abcd at December 22. 2008Hi can any one tell me how to find out parent and child table of a table in aschema
Regards
kanak
Re: child table and parent tables
Posted by perallis at December 22. 2008To check what tables are children from table TAB_A and schema TABS_B, perform the select below:
db2 "select substr(TABNAME,1,20),substr(REFTABNAME,1,20) from syscat.references where TABNAME='TABA' and TABSCHEMA='TABS_B'"
To check what tables are parents from table TAB_A and schema TAB_B perform the select below:
db2 "select substr(REFTABNAME,1,20), substr(TABNAME,1,20) from syscat.references where REFTABNAME='TAB_A' and TABSCHEMA='TABS_B'"
Powered by
Ploneboard