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

Home -> Community -> Usenet -> c.d.o.misc -> Re: query

Re: query

From: Chris Nelson <wrhs71_at_hotmail.com>
Date: Thu, 18 Mar 1999 01:54:11 -0500
Message-ID: <zq1I2.828$mZ6.2323@news7.ispnews.com>


This actually works, and it could be made prettier, but it's too late tonight (too early this morning) to do that. Notice that the ''' below are THREE SINGLE quotes, not a double and a single. If you just cut and paste this from the mail to your editor, then save as 'my_row_counter.sql' or some such, it ought to work fine.

SET feedback OFF heading OFF
SPOOL my_counter.sql

SELECT 'SELECT ''' || owner || ''', ''' || table_name

 || ''', ' || 'COUNT (*) FROM ' || owner || '.'
 || table_name || ', dual' || CHR(10)
 || '/'

FROM sys.all_tables
/

SPOOL OFF @my_counter
/
SET heading ON feedback ON

If you notice, it sets up and then runs another file called 'MY_COUNTER.SQL', so if you have such a file in your SQL directory, then you'd better change that or the reference above...

Chris

RC wrote in message <36EEBC0F.9FFC047E_at_columbia.edu>...
>Anyone know how to do a select statement to count the number of columns
>for each table(32) in your database?
Received on Thu Mar 18 1999 - 00:54:11 CST

Original text of this message

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