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: <Brian_McQuillan_at_gelco.com>
Date: Wed, 20 Jun 2001 09:29:15 -0700
Message-ID: <F001.00330719.20010620093242@fatcity.com>

Lee,

try this script - it should do what you want

Brian

<start script>

set pause off
set pages 0
set feedback off
set echo off
set verify off

accept TNAME prompt "Enter the table name / string, hit <ENTER> for all tables : " accept TOWNER prompt "Enter the table owner to count, hit <ENTER> for default user : " spool c:\temp\work_count_tables.sql

select 'select count(*),'||''''||table_name||''''||' from '||owner||'.'||table_name||' ;'
from all_tables
where table_name like upper('%'||'&TNAME'||'%')   and owner like '%'||decode('&TOWNER',null,upper(user),upper('&TOWNER'))||'%' order by table_name
/

spool off

@c:\temp\work_count_tables

set pause on
set pages 23
set feedback on

<end script>

Robertson Lee - lerobe <lerobe_at_acxiom.co.uk>@fatcity.com on 06/20/2001 12:17:09 PM

Please respond to ORACLE-L_at_fatcity.com

Sent by: root_at_fatcity.com

To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> cc:

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.

--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author:
  INET: Brian_McQuillan_at_gelco.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Jun 20 2001 - 11:29:15 CDT

Original text of this message

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