-- The code below works.
declare
v_row integer := 0;
v_rowcnt integer;
begin
for t in (select table_name from user_tables order by 1) loop
v_row := v_row + 1;
execute immediate 'select count(*) from ' || t.table_name into v_rowcnt;
dbms_output.put_line (rpad(v_row, 5, ' ') || (rpad(t.table_name,40,'.') || v_rowcnt));
end loop;
end;
/
--#############################################################
I want to add the corresponding Tablespace_Name to the output for it to look like
1 ACCOUNT................................23..............Adv_Data
2 AD...................................... 50..............Adv_Data
3 AD_AGE_STATED...................70.............Adv_Data
4 AD_BODY.................................60............ Bev_Data
5 AD_CATEGORY......................45..............Adv_Data
6 AD_LOCATION_STATED.......25..............Bev_Data
What change to make in the code on top.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.