oracle - Row count of all tables in a schema -


declare      v_owner varchar2(40);      v_table_name varchar2(40);      cursor get_tables          select distinct table_name              , user            user_tables           lower(user) = 'schema_name'     ;   begin      open get_tables;      loop         fetch get_tables          v_table_name             , v_owner             ;          exit when get_tables%notfound;         execute immediate               'insert                 stats_table                    ( table_name                    , schema_name                    , record_count                    , created                    )                       select '''                                  || v_table_name                     || ''' , ''' || v_owner                     || ''' ,        count(*)                           ,        to_date(sysdate,''dd-mon-yy'')                        '   || v_table_name         ;      end loop;      close get_tables;  end;  

i using row counts of tables in schema. got query stackoverflow.

i ran procedure compiled unable view result y so?

i new pl/sql can explain select statement after excute immediate query unable understand logic behind.

the row counts inserted table name stats_table. need run

select * stats_table 

after running procedure


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -