how to know total rows from all_tables

DECLARE
CURSOR c1 IS
select TNAME from tab
where tabtype = ‘TABLE’
order by tabtype;
c1rec c1%ROWTYPE;
c number:=0;
jum number:= 0;
BEGIN
dbms_output.put_line(‘NO’||chr(9)||’NAMA_TABEL’||chr(9)||’JUMLAH_RECORD’);
OPEN c1;
LOOP
FETCH c1 INTO c1rec;
EXIT WHEN c1%NOTFOUND;
c:=c+1;
execute immediate ‘select /*+ FIRST_ROWS */ count(1) from ‘||c1rec.tname
into jum;
dbms_output.put_line(to_char(c,’0009′)||chr(9)||c1rec.tname||chr(9)||ltrim(to_char(jum,’999.999.999.999′)));
END LOOP;
CLOSE c1;
END;

http://sikathabis.wordpress.com/2009/11/06/plsql-how-to-know-total-rows-from-all_tables/

Leave a Reply