All Forums Database
krishnaprasadmt 2 posts Joined 01/12
31 Aug 2014
SQL query to understand the names of all the available tables in the database , number of records for all these tables and s

Hi

Please help me with a SQL query to understand the names of all the available tables in the database , number of records for all these tables and size of all these tables ?

Regards,
Prasad

Glass 225 posts Joined 04/10
31 Aug 2014

Prasad,
You can use "help database databasename;" 
or 
Select * from dbc.tables where databasename = 'databasename';
For count:
Select 'Select count(*) from trim(databasename)||'.'||trim(tablename)||';'
from dbc.tables where databasename = 'databasename';
then execute the results.
 
Rglass
 

Glass 225 posts Joined 04/10
31 Aug 2014

Also,
dbc.tablesizev for tablesize.

srik16 14 posts Joined 08/14
31 Aug 2014

is there any  dbc object to find the actual count of each table ?
 

SC

Raja_KT 1246 posts Joined 07/09
01 Sep 2014

Are your statistics up-to-date ?

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

HarshaKudumula 83 posts Joined 04/09
21 Oct 2014

srik16, May i know your client DBMS version?

You must sign in to leave a comment.