create or replace procedure proc_check_table
is
cursor c_table is select table_name from check_table where status='Y';
v_count number(10);
v_table_name check_table.table_name%type;
sql_str varchar2(500);
begin
open c_table;
loop
fetch c_table into v_table_name;
exit when c_table%notfound;
sql_str:='select count(1) from (select * from live_catb.'||v_table_name||'@mon_to_catb minus select * from catb_ogg.'||v_table_name||')';
--dbms_output.put_line(sql_str);
execute immediate sql_str into v_count;
dbms_output.put_line('table '||v_table_name||' out of sync rows is:'||v_count);
end loop;
close c_table;
end;
/
is
cursor c_table is select table_name from check_table where status='Y';
v_count number(10);
v_table_name check_table.table_name%type;
sql_str varchar2(500);
begin
open c_table;
loop
fetch c_table into v_table_name;
exit when c_table%notfound;
sql_str:='select count(1) from (select * from live_catb.'||v_table_name||'@mon_to_catb minus select * from catb_ogg.'||v_table_name||')';
--dbms_output.put_line(sql_str);
execute immediate sql_str into v_count;
dbms_output.put_line('table '||v_table_name||' out of sync rows is:'||v_count);
end loop;
close c_table;
end;
/