IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to find number of child tables


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
somapradeep1

New User


Joined: 07 Sep 2010
Posts: 22
Location: hyderabad

PostPosted: Tue Oct 04, 2011 2:31 pm
Reply with quote

i have a scenario like, i want to find out the number of child tables for a parent table without seeing the application program.Is there any possiblity to write a sql query for this?
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Tue Oct 04, 2011 7:24 pm
Reply with quote

all the info is in
Code:
select * from sysibm.sysrels
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6965
Location: porcelain throne

PostPosted: Tue Oct 04, 2011 7:38 pm
Reply with quote

thank you GuyC
Back to top
View user's profile Send private message
jerryte

Active User


Joined: 29 Oct 2010
Posts: 205
Location: Toronto, ON, Canada

PostPosted: Thu Oct 06, 2011 2:32 am
Reply with quote

If you want just the number of tables then you can use SYSIBM.SYSTABLES. The column name is CHILDREN.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Thu Oct 06, 2011 9:04 am
Reply with quote

Hello,

Keep in mind that there are often logical "child tables" - that are only "children" due to usage, not definition.

In my experience, there are more incompletely defined databases in use than ones that have been done in such a way the children can be discovered by some simple query. . .
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Question regarding ISPF tables with T... TSO/ISPF 11
No new posts Identify Number of Multivolume Dataset All Other Mainframe Topics 5
No new posts To join 2 tables and to join 3rd tabl... DB2 8
No new posts sort to find out the char which repea... Mainframe Interview Questions 10
No new posts Compare 2 alphabets in a REXX and fin... CLIST & REXX 2
Search our Forums:


Back to Top