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 -> SQL - Count of Rows into a table

SQL - Count of Rows into a table

From: RxB <rvbaker_at_mindspring.com>
Date: Thu, 27 Jan 2000 21:26:20 -0500
Message-ID: <86quo9$ttd$1@nntp6.atl.mindspring.net>


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

Original text of this message

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