Monday, March 18, 2013

Get row count of all tables from oracle schema

It is possible to get the total row count of all tables from a given schema using a single sql. Below one will work.


select table_name, to_number( extractvalue( xmltype( dbms_xmlgen.getxml('select count(*) c from '||table_name ) ) ,'/ROWSET/ROW/C' ) ) count from user_tables;


Hope this one helped you... :-)


No comments:

Get function name programaticaly - Python

This little piece of code will help you to get the function name programatically. This is very helpful when you are implementing the debug...