Count rows for all tables

Need to count all the rows for the tables in a schema -

SQL> l
    select
       table_name,
       to_number(
       extractvalue(
          xmltype(
             dbms_xmlgen.getxml('select count(*) c from '||table_name))
        ,'/ROWSET/ROW/C')) count
    from  user_tables order by 2
   
Handy.




No comments:

Post a Comment