Create or replace procedure p1 ()
As
Declare
Recid varchar2(100)
Cursor c1 is
Select a.recid from f_ac_event a,f_ac_event@abnprod b where
a.recid=b.recid;
Begin
Open c1;
loop
Fetch c1 into recid
If c1%found then
Delete from f_ac_event where recid=?;
Dbms_output.put_line(recid || ‘deleted’)
Exit when c1%notfound;
End if;
End loop;
Close c1;
End;
/