View previous topic :: View next topic |
Author |
Message |
tekwhiz2002 Beginner

Joined: 09 Aug 2005 Posts: 3 Topics: 3
|
Posted: Tue Feb 05, 2008 8:37 am Post subject: How to list tables in order (parent & child relationship |
|
|
Is there a way to list (using db2 command or catalogs) to list hierarchy of
table parent & child relationship:
1) A list that shows which table should be deleted first,second,third...
2) A list that shows which table should loaded first, second,third...
Thanks in advance |
|
Back to top |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Wed Feb 06, 2008 3:16 am Post subject: |
|
|
tekwhiz2002,
You can use the below query to find out.
Code: | SELECT * FROM SYSIBM.SYSRELS WHERE CREATOR LIKE '____' |
____ ----> creator id or subsystem id.
In the result,
TBNAME : Refers to the child table name
RELNAME: Name of the Referential constraint
REFTBNAME: Refers to the parent table name
REFTBCREATOR: Owner of the parent table (REFTBNAME)
You can check the below links for more info.
1. Retrieving catalog information about foreign keys
2. SYSIBM.SYSRELS table |
|
Back to top |
|
 |
|
|