By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,611 Members | 1,693 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,611 IT Pros & Developers. It's quick & easy.

Statistics - Table Name, Number of Rows, Number of Columns

P: n/a
Hello,

I want to list the User Tables which I have created (I am aware of the
Schema Name where the tables are residing). The goal is to achieve the
following output with one single command or script:
TABLE_NAME NUMBER_OF_ROWS NUMBER_OF_COLS
How do I achieve this in one shot?

I am aware of writing a program (Stored Proc) and writing a Loop to get
this.

But I am intersted in any straight way to do this directly (from DB2
command prompt) using single SQL Statement or some kind of Unix Script.

I am using IBM DB2 UDB 8.1.

Regards,
Kamlesh

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ka*********@yahoo.com wrote:
Hello,

I want to list the User Tables which I have created (I am aware of the
Schema Name where the tables are residing). The goal is to achieve the
following output with one single command or script:
TABLE_NAME NUMBER_OF_ROWS NUMBER_OF_COLS
How do I achieve this in one shot?

I am aware of writing a program (Stored Proc) and writing a Loop to get
this.

But I am intersted in any straight way to do this directly (from DB2
command prompt) using single SQL Statement or some kind of Unix Script.


Collect statistics on all the tables and then query the system catalog,
namely SYSCAT.TABLES contains all the information you request. (See the
columns COLCOUNT and CARD along with TABSCHEMA and TABNAME.)

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.