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: <Yosi_at_comhill.com>
Date: Wed, 20 Jun 2001 10:04:40 -0700
Message-ID: <F001.003308A2.20010620101051@fatcity.com>

I use
this script, counter.sql:
<FONT face=Arial color=#0000ff
size=2> 
set
echo offset pages 0set trimspool onset lines 199set feed off
set
term offspool counter1.sql
 
prompt
col  table_name form
a30          head 'Table
Name'prompt col  cnt        form
9999,999,999 head 'Count'prompt spool counter.lstprompt set term onprompt prompt Table

Name                             
Countprompt prompt ------------------------------ 
-------------.
 
select
'select ''' || table_name || ''' table_name, count(*) cnt from ' || table_name || ';'from user_tables/prompt spool offprompt set feed onprompt set pages 40spool offset term on_at_counter1$ del counter1.sql
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid">
<FONT face=Tahoma

  size=2>-----Original Message-----From: Robertson Lee - lerobe   [mailto:lerobe_at_acxiom.co.uk]Sent: Wednesday, June 20, 2001 1: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 - 12:04:40 CDT

Original text of this message

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