Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > IBM DB2 > Re: Get a COUNT...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 5 Topic 8843 of 9234
Post > Topic >>

Re: Get a COUNT(*) for all tables in a schema?

by Serge Rielau <srielau@[EMAIL PROTECTED] > Apr 30, 2008 at 01:19 PM

ChrisC wrote:
> --CELKO-- wrote:
>> Is there a simple way to get  a COUNT(*) for all tables in a schema in
>> DB2 LUW 9.0?
> 
> Well, if the tables are mostly static and you have current statistics
> OR your tables are very dynamic and you have sufficiently recent
> statistics, selecting from the catalog works great:
> 
> select tabname, card from syscat.tables where tabschema =
> '<schemaName>'
> 
> (noting that for very dynamic table sizes, the exact COUNT(*) isn't
> often accurate in any case for long).
.... otherwise you need to scribble up a stored proc with dynamic SQL 
inside..

Cheers
Serge


-- 
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
 




 5 Posts in Topic:
Get a COUNT(*) for all tables in a schema?
--CELKO-- <jcelko212@[  2008-04-30 09:41:45 
Re: Get a COUNT(*) for all tables in a schema?
ChrisC <cunningham.cb@  2008-04-30 09:56:09 
Re: Get a COUNT(*) for all tables in a schema?
Serge Rielau <srielau@  2008-04-30 13:19:46 
Re: Get a COUNT(*) for all tables in a schema?
Lennart <Erik.Lennart.  2008-04-30 12:05:53 
Re: Get a COUNT(*) for all tables in a schema?
bwmiller16@[EMAIL PROTECT  2008-05-01 08:16:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Aug 29 18:01:05 CDT 2008.