You may need this to list all the tables from an Oracle tablespace with the record or row count The list of tables comes from a SQL, but the rest must be done with PL/SQL

DECLARE
val NUMBER;
BEGIN
FOR I IN (select table_name from all_tables where owner = 'TABLESPACE')
LOOP
EXECUTE IMMEDIATE 'SELECT count(*) FROM TABLESPACE.' || i.table_name INTO val;
DBMS_OUTPUT.PUT_LINE(i.table_name || ' ==> ' || val );
END LOOP;
END;
view raw list_tables.sql hosted with ❤ by GitHub