|
-
Got it , Here are the steps
1) create table test_table (id number , table_name varchar2(30) , num_rows number , cnt number ) ;
2) create table test2 select table_name , num_rows from user_tables;
3) insert into test_table (table_name , num_rows ) select (table_name , num_rows ) from test2;
4 ) commit;
5) create sequence test_seq nomaxvalue nocycle ;
6) update table test_table set id = test_seq.nextval;
7 ) commit;
8 ) declare
v_table_name VARCHAR2(30);
v_cnt number ;
v_counter number := 1;
stmt_str varchar2(4000) ;
begin
for v_counter in 1.. 100 loop
select table_name into v_table_name from test_table where id = v_counter;
dbms_output.put_line (v_table_name ) ;
stmt_str := 'select count(*) from '||v_table_name ||'';
dbms_output.put_line(stmt_str);
execute immediate stmt_str into v_cnt ;
update test_table set cnt = v_cnt where table_name = v_table_name ;
dbms_output.put_line(v_cnt);
commit;
end loop;
end ;
9 ) select table_name from test_table where cnt - num_rows > 10000 ;
Thats all , It works
Thanks guys
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|