create or replace procedure update
is
cursor c1 is
select s.id as column1,t.huzhu_name as column2 from table1 s,table2 t where t.id=s.apply_id ;
begin
for r1 in c1 loop
update table1 a set a.huzhu_name=r1.column2 where a.id=r1.column1;
commit;
end loop;
end update;
is
cursor c1 is
select s.id as column1,t.huzhu_name as column2 from table1 s,table2 t where t.id=s.apply_id ;
begin
for r1 in c1 loop
update table1 a set a.huzhu_name=r1.column2 where a.id=r1.column1;
commit;
end loop;
end update;
本文介绍了一个使用PL/SQL编写的存储过程示例,该过程通过游标遍历两个表连接后的结果集,并更新其中一个表的数据。具体操作包括定义游标、循环读取记录并更新对应表中的字段。

1279

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



