1.
create or replace procedure pro_test_01 is
begin
for aa in (select object_name from test_01)
loop
insert into test_02 values (aa.object_name);
end loop;
end;
2.
create or replace procedure pro_test_02 is
begin
declare
cursor aa is
select object_name from test_01;
begin
for ss in aa loop
begin
insert into test_02 values (ss.object_name);
commit;
end;
end loop;
end;
end;
本文介绍了一种使用 Oracle PL/SQL 过程来从一个表批量读取数据并插入到另一个表的方法。通过两个具体的例子展示了如何定义游标、使用循环结构进行数据处理,并且在每次循环中插入数据以及手动提交事务。
8万+

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



