View previous topic :: View next topic
|
Author |
Message |
senthil1711 Warnings : 1 New User
Joined: 27 Feb 2008 Posts: 10 Location: bangalore
|
|
|
|
Hi,
How to know the number of TABLEs in a DB2 DATABASE...?
Is there any QUERY for that.? |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
search in SYSIBM.SYSTABLES |
|
Back to top |
|
|
senthil1711 Warnings : 1 New User
Joined: 27 Feb 2008 Posts: 10 Location: bangalore
|
|
|
|
hi,
thanks.
could u plz tell where to search for SYSIBM.SYSTABLES. I tried but i can't access some of the options. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
senthil1711 wrote: |
I tried but.. |
Hi,
Where did You try..? If the next question is..
Quote: |
could u plz tell where to search for SYSIBM.SYSTABLES |
|
|
Back to top |
|
|
senthil1711 Warnings : 1 New User
Joined: 27 Feb 2008 Posts: 10 Location: bangalore
|
|
|
|
sorry..
the statement : "I tried but i can't access some of the options"--> is for...when i am trying to find where to look for "SYSIBM.SYSTABLES".. I tried some options where SPUFI and similar options are listed. Ex. for
"BMC ADMINISTRATIVE TOOLS FOR DB2" option I could not access it.
So, sorry for the confusion. If u know where to look for SYSIBM.SYSTABLES, plz write. |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 631 Location: Wisconsin
|
|
|
|
SELECT xxx from SYSIBM.SYSTABLES WITH UR; |
|
Back to top |
|
|
senthil1711 Warnings : 1 New User
Joined: 27 Feb 2008 Posts: 10 Location: bangalore
|
|
|
|
Hi Steve
thank you |
|
Back to top |
|
|
jitendersinghbhiwani
New User
Joined: 15 Jun 2007 Posts: 2 Location: Chennai
|
|
|
|
Hi,
Use the query
SELECT COUNT(*) From SYSIBM.SYSTABLES
WHERE CREATOR = 'XXXX'
in SPUFI or QMF. USE the DB2 region in place of XXXX where you want to find the tables.
If you want to get the list of tables then use SELECT * in place of SELECT COUNT(*)
ok |
|
Back to top |
|
|
senthil1711 Warnings : 1 New User
Joined: 27 Feb 2008 Posts: 10 Location: bangalore
|
|
|
|
hi jitender,
i used the query..
SELECT COUNT(*) From SYSIBM.SYSTABLES;
and it listed all the table names.
thanks. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
senthil1711 wrote: |
SELECT COUNT(*) From SYSIBM.SYSTABLES;
and it listed all the table names. |
Hello,
This will return the count (number of) tables & not the list. For that
Code: |
SELECT * From SYSIBM.SYSTABLES
with ur; |
would work. |
|
Back to top |
|
|
senthil1711 Warnings : 1 New User
Joined: 27 Feb 2008 Posts: 10 Location: bangalore
|
|
|
|
hi anuj,
thanks |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
SELECT xxx from SYSIBM.SYSTABLES WITH UR; |
will display the xxx column
Quote: |
SELECT count(*) from SYSIBM.SYSTABLES WITH UR; |
will display the TOTAL number of the tables in the DB2 instance irrelevant of the database
Quote: |
SELECT DISTINCT DBNAME from SYSIBM.SYSTABLES ORDER BY DBNAME WITH UR; |
will display all the DATABASES defined in the DB2 instance
Quote: |
SELECT DBNAME count(*) FROM SYSIBM.SYSTABLES GROUP BY DBNAME ORDER BY DBNAME WITH UR; |
will return a list of all the databases with the number of tables defined in each database
Quote: |
SELECT DBNAME,TBNAME FROM SYSIBM.SYSTABLES ORDER BY DBNAME,TBNAME WITH UR; |
will return a list of all the databases with the tables defined in each database |
|
Back to top |
|
|
|