假设游标a与游标b数据相加的条件是 a.字段2=b.字段2; 以下示例只向e插入一个字段
create or replace Test_sp
authid current_user as
cursor a is select 字段1,字段2,。。 from table1;
cursor b is select 字段1,字段2,。。 from table2;
cursor c is select 字段1,字段2,。。 from table3;
cursor d is select 字段1,字段2,。。 from table4;
begin
for item1 in a loop
for item2 in b loop
if item1.字段2=item2.字段2 then
insert into e(字段1) values(item1.字段1+item2.字段1);
commit;
end if;
end loop;
end loop;
for items in c loop
insert into e(字段1) values(items.字段1);
commit;
end loop;
for items in d loop
insert into e(字段1) values(items.字段1);
commit;
end loop;
end Test_sp;