|
View previous topic :: View next topic
|
| Author |
Message |
somapradeep1
New User
Joined: 07 Sep 2010 Posts: 22 Location: hyderabad
|
|
|
|
| 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 |
|
 |
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
all the info is in
| Code: |
| select * from sysibm.sysrels |
|
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
| thank you GuyC |
|
| Back to top |
|
 |
jerryte
Active User

Joined: 29 Oct 2010 Posts: 205 Location: Toronto, ON, Canada
|
|
|
|
| If you want just the number of tables then you can use SYSIBM.SYSTABLES. The column name is CHILDREN. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
|
|