Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> SQL - Count of Rows into a table
Hi
I'm trying to write some SQL to record the rowcount from each of my fifteen
or so tables into a timestamped table. This is to provide me with history
of the growth of
my tables.
Table def'n something like this
Table - table_count
(table_name varchar2(25) dated date default (sysdate) row_count number)
I would like to automate the population of this to run on a daily basis.
Can anyone help with this task..... I know I could generate a list of my tables from all_tables (where owner = 'FRED') and then step through them with a cursor, selecting the count(*), and then insert this number into the table .... however this seems very 3GLish. There must be an easy relational way to do this in (possbily) one step.
Hope someone can help, because I feel I'm re-inventing the wheel thnking about this !!!
Rog Received on Thu Jan 27 2000 - 20:26:20 CST