Count rows in Maximo schema tables
Problem
------------------
How do I get count of all tables in Maximo with on single query?
Solution
-----------------
Just three steps, thats all ..
--; Create function
create or replace
function count_rows(OBJECTNAME varchar2)
return varchar2 is
i number;
r sys_refcursor;
begin
open r for 'select count(*) c from MAXIMO.'||OBJECTNAME;
fetch r into i;
return i;
EXCEPTION
WHEN OTHERS THEN
return -1 ;
End;
--; SQL query
select db.owner, db.table_name, count_rows(db.table_name) ROW_COUNT
from all_tables db
where db.owner = 'MAXIMO'
order by db.owner, db.table_name;
--; Drop function
drop function count_rows;
Share this post
Blog Comments
Thank You! You comment is under review and will be published soon..
Thank You! You comment is Published.
Popular posts
Bulk add/remove of access rights
2015-01-03
Get Maximo location hierarchy
2017-11-08
Find and compile invalid Maximo objects
2016-05-05
Change NLS_LENGTH_SEMANTICS to CHAR
2015-03-01
Skip doclinks copy on object duplication
2019-06-27