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;
博客展示了Oracle存储过程的声明与实现,定义了记录类型,通过循环将test2表数据插入到test2@mydblink中,最后提交事务。还给出了测试该存储过程的代码。
1949

被折叠的 条评论
为什么被折叠?



