Re: SQL EXPERTS ONLY

From: Simon Stow <sstow_at_uk.oracle.com>
Date: 1996/07/30
Message-ID: <31FDF44F.1A41_at_uk.oracle.com>#1/1


  1. in user_tables there is a NUM_ROWS column so:

        select table_name, num_rows from user_tables;

looks like it oughta work, but doesn't, at least not on my database - num_rows is null for all tables - maybe it requires something else to be switched on?

2. Use some PL/SQL to fetch all the table name from user_tables and then loop thru each selecting count(*)

3. as below ...

Steve Cosner wrote:
>
> In article <4tip79$q5u_at_newsbf02.news.aol.com>,
> MGreen1962 <mgreen1962_at_aol.com> wrote:
> >I need to produce a report that shows how many records are in each table.
> >i.e:
> >
> >Table_Name Number Recs
> >----------------------------------------------------------------------
> >Employees 413
> >Customer 5257
> >How can I do this? <snip>
>
> Try:
>
> select 'Table1' "Table",count(*)" Rows " from table1
> UNION ALL
> select 'Table2' "Table",count(*)" Rows " from table2
> UNION ALL ... etc.
>
> HTH
> Steve Cosner
 

-- 
The statements and opinions expressed here are my own and   
do not necessarily represent those of Oracle Corporation.
Received on Tue Jul 30 1996 - 00:00:00 CEST

Original text of this message