MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to list tables in order (parent & child relationship

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
tekwhiz2002
Beginner


Joined: 09 Aug 2005
Posts: 3
Topics: 3

PostPosted: Tue Feb 05, 2008 8:37 am    Post subject: How to list tables in order (parent & child relationship Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Wed Feb 06, 2008 3:16 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group