create or replace procedure count_table iscursor c1 isselect * from user_tables;nm number(9);nm1 varchar2(100);begin delete from temp1;commit; for i in c1 loop--execute immediate 'select count(*) into '||nm||' from '||i.table_name;--EXECUTE IMMEDIATE 'create table temp1(table_name varchar2(100),no_of_rows number(10))';EXECUTE IMMEDIATE 'select count(*) from ' || i.table_name INTO nm;nm1:=i.table_name;insert into temp1 values (nm1,nm);end loop;commit; end count_table;
create or replace procedure count_table is
ReplyDeletecursor c1 is
select * from user_tables;
nm number(9);
nm1 varchar2(100);
begin
delete from temp1;
commit;
for i in c1
loop
--execute immediate 'select count(*) into '||nm||' from '||i.table_name;
--EXECUTE IMMEDIATE 'create table temp1(table_name varchar2(100),no_of_rows number(10))';
EXECUTE IMMEDIATE 'select count(*) from ' || i.table_name INTO nm;
nm1:=i.table_name;
insert into temp1 values (nm1,nm);
end loop;
commit;
end count_table;