Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Script for total number of rows

Re: Script for total number of rows

From: Pinaki <bpinaki123_at_indiatimes.com>
Date: 18 Apr 2002 01:35:25 -0700
Message-ID: <96eccafc.0204180035.5fa12450@posting.google.com>


bricklen13_at_hotmail.com (Bricklen Anderson) wrote in message news:<b416ca2d.0204171406.4735cbf8_at_posting.google.com>...
> how about this? (not very elegant I'm afraid):
>
> set serveroutput on 1000000
> set termout off
> spool count_contents.sql
> begin
> for x in (select table_name from user_Tables) loop
> dbms_output.put_line('select count(*) '||x.table_name||' from '||x.table_name||';');
> end loop;
> end;
> /
> spool off
> set termout on
> @@count_contents.sql
>
>
> bpinaki123_at_indiatimes.com (Pinaki) wrote in message news:<96eccafc.0204171012.558f7ae0_at_posting.google.com>...
> > Hi,
> > I am a beginner in Oracle.I need a script that will show the
> > total number of rows in all the tables in a specific schema.I can
> > select the "NUM_ROWS" along with the table_names from user_tables but
> > for that I have to run "Analyze table t compute statistics" for each
> > table and I want to avoid doing that. Is there any way I can write a
> > PL/SQL script that I can store in the database which will retrieve the
> > information I want...
> >
> > Thanks,
> > Pinaki

Thanks for the replies... But I am not able to figure out how to write a cursor using dynamic plsql to retrieve the number of rows for each table(I am just started with Oracle).

Thanks,
Pinaki Received on Thu Apr 18 2002 - 03:35:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US