Personal tools
You are here: Home Forums DB2 child table and parent tables
Navigation
Log in


Forgot your password?
 
Document Actions

child table and parent tables

Up to DB2

child table and parent tables

Posted by abcd at December 22. 2008

Hi 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. 2008

To 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
Security Awareness
Would you like your company to implement gamification into your security awareness program?





Polls