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: 6966
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: 202
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: 19244
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Increase the number of columns in the... IBM Tools 3
Search our Forums:

Back to Top