Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: query
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) || '/'
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
![]() |
![]() |