SQL query to understand the names of all the available tables in the database , number of records for all these tables and s

Database

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
5 REPLIES
Enthusiast

Re: SQL query to understand the names of all the available tables in the database , number of records for all these tables and s

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

Enthusiast

Re: SQL query to understand the names of all the available tables in the database , number of records for all these tables and s

Also,

dbc.tablesizev for tablesize.

Enthusiast

Re: SQL query to understand the names of all the available tables in the database , number of records for all these tables and s

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

Enthusiast

Re: SQL query to understand the names of all the available tables in the database , number of records for all these tables and s

Are your statistics up-to-date ?

Enthusiast

Re: SQL query to understand the names of all the available tables in the database , number of records for all these tables and s

srik16, May i know your client DBMS version?