Syed Saad Ali

Oracle ACE Pro

Oracle Solution Architect

Oracle E-Business Suite

Oracle Cloud Infrastructure

Oracle Fusion Middleware

Oracle Database Administration

Oracle Weblogic Administration

Syed Saad Ali

Oracle ACE Pro

Oracle Solution Architect

Oracle E-Business Suite

Oracle Cloud Infrastructure

Oracle Fusion Middleware

Oracle Database Administration

Oracle Weblogic Administration

Blog Post

PL/SQL Code for Counting Rows In Schema Tables

September 1, 2017 Database Scripts, Scripts
PL/SQL Code for Counting Rows In Schema Tables

PL/SQL Code for Counting Rows In Schema Tables

 

DECLARE
i INTEGER;
BEGIN
dbms_output.Put_line(‘Table Name,Row Count,’
|| To_char(SYSDATE, ‘DD-MON-YYYY HH24:MI:SS’));

FOR v_table IN (SELECT ut.table_name
FROM   user_tables ut) LOOP
EXECUTE IMMEDIATE ‘select count(*) from ‘|| v_table.table_name INTO i;

dbms_output.Put_line(v_table.table_name
|| ‘,’
|| To_char(i));
END LOOP;
END;

 

 

Related Posts
Write a comment