I use this script, counter.sql:
 
set echo off
set pages 0
set trimspool on
set lines 199
set feed off
set term off
spool counter1.sql
 
prompt col  table_name form a30          head 'Table Name'
prompt col  cnt        form 9999,999,999 head 'Count'
prompt spool counter.lst
prompt set term on
prompt prompt Table Name                             Count
prompt prompt ------------------------------ -------------.
 
select 'select ''' || table_name || ''' table_name, count(*) cnt from ' || table_name || ';'
from user_tables
/
prompt spool off
prompt set feed on
prompt set pages 40
spool off
set term on
@counter1
$ del counter1.sql
-----Original Message-----
From: Robertson Lee - lerobe [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 20, 2001 1:17 PM
To: Multiple recipients of list ORACLE-L
Subject: Quick select question

All,
 
Anyone know how to get a list of tablenames and the count of rows in them
 
TABLE_NAME    COUNT
===========   ======
LEE                        10
LEE1                       25
LEE2                      17................etc etc
 
I know it can be done if the tables are analyzed and from user_tables but was wanting to know how to do it from sqlplus.
 
 
Tru64
8.0.5.0.0
 
 
TIA
 
Lee

 


The information contained in this communication is
confidential, is intended only for the use of the recipient
named above, and may be legally privileged. If the reader
of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.
If you have received this communication in error, please
re-send this communication to the sender and delete the
original message or any copy of it from your computer
system.

Reply via email to