declaration and emplementation of procedure
create or replace procedure myprocedure is
type mysyn is record(
aa varchar(20),
bb number(20));
begin
for mysyn in (select * from test2) loop
insert into test2@mydblink(aa,bb)
values(mysyn.aa,mysyn.bb);
end loop;
commit;
end;
test the procedure
begin
-- Call the procedure
myprocedure;
end;