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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Quick select question

RE: Quick select question

From: Kevin Lange <kgel_at_ppoone.com>
Date: Wed, 20 Jun 2001 15:37:20 -0700
Message-ID: <F001.00330F3B.20010620151154@fatcity.com>

set
pagesize 0
set
feedback off
set
echo off
set
termout off
spool
c:\temp.sql
select
'select rpad('''||owner||'.'||table_name||''',50), to_char(count(*),''999999999999'') from '||owner||'.'||table_name||';' from dba_tables;
spool
off;
set
termout on
<SPAN
class=140041022-20062001>@c:\temp.sql
<SPAN
class=140041022-20062001> 
<SPAN
class=140041022-20062001> 
<SPAN
class=140041022-20062001> 
<SPAN
class=140041022-20062001> 
You
can add whatever where clause to the above sql ... it formats 50 characters for the owner/table_name and 10 digits for the count.  Change to suite you.

<FONT face=Tahoma

  size=2>-----Original Message-----From: Robertson Lee - lerobe   [mailto:lerobe_at_acxiom.co.uk]Sent: Wednesday, June 20, 2001 12:17   PMTo: Multiple recipients of list ORACLE-LSubject: Quick   select question
<SPAN

  class=625121716-20062001>All,
<SPAN

  class=625121716-20062001> 
  Anyone know how to
  get a list of tablenames and the count of rows in them
<SPAN

  class=625121716-20062001> 
<SPAN

  class=625121716-20062001>TABLE_NAME    COUNT
<SPAN

  class=625121716-20062001>===========   ======
<SPAN

  class=625121716-20062001>LEE                        
  10
<SPAN
  class=625121716-20062001>LEE1                       
  25
<SPAN
  class=625121716-20062001>LEE2                      
  17................etc etc

<SPAN

  class=625121716-20062001> 
  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.
<SPAN

  class=625121716-20062001> 
<SPAN

  class=625121716-20062001> 
  Tru64   

<SPAN

  class=625121716-20062001>8.0.5.0.0
<SPAN

  class=625121716-20062001> 
<SPAN

  class=625121716-20062001> 
<SPAN

  class=625121716-20062001>TIA
<SPAN

  class=625121716-20062001> 
<SPAN

  class=625121716-20062001>Lee   

   The information contained in this
  communication isconfidential, is intended only for the use of the   recipientnamed above, and may be legally privileged. If the reader of   this message is not the intended recipient, you arehereby notified that   any dissemination, distribution orcopying 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 computersystem. Received on Wed Jun 20 2001 - 17:37:20 CDT

Original text of this message

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