is
--利用游标 循环插入各个病区
cursor c_departid is select * from sys_department;
v_cinfo c_departid%rowtype;
pr_wardid number(3);
pr_num number(2);
begin
pr_wardid :=100;
pr_num :=2;
execute immediate 'truncate table sys_ward';---执行清空表
---循环2次
while pr_num>0 loop
--游标循环
for v_cinfo in c_departid loopinsert into ……;
end loop;
pr_num :=pr_num-1;
end loop;
commit;
end; 原文链接:https://www.f2er.com/oracle/209740.html