张兴康 发表于 2020-7-23 14:07:08

oracle存储过程循环修改

create or replace procedure update
is
cursor c1 is
select s.id as column1,t.huzhu_name as column2from table1 s,table2 twhere 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;

张兴康 发表于 2020-7-23 14:08:10

{:soso__11494044397719366072_2:}

fteair 发表于 2020-7-23 17:46:28

{:soso__6565372531573890130_4:}

张兴康 发表于 2020-7-24 14:22:47

{:soso__6468533990763016983_4:}

fteair 发表于 2020-7-24 17:30:12

{:soso__2800774823969466670_4:}

张兴康 发表于 2020-7-26 14:34:49

{:soso__10338656970872041109_3:}

fteair 发表于 2020-7-26 17:38:37

{:soso__10615784733045253186_1:}

张兴康 发表于 2020-7-28 17:29:21

{:soso__3951476534595763788_1:}
页: [1]
查看完整版本: oracle存储过程循环修改