Oracle的一个简单存储过程

2014-11-24 02:42:25 · 作者: · 浏览: 2

create or replace procedure clearTypes is

c_id integer;

tps varchar(100);

cursor c_1 is

select id, assettypes from folder where assettypes is not null;

begin

open c_1;

loop

fetch c_1 into c_id, tps;

delete from cont2flder_1026_2 where folderid = c_id and instr(tps, assettype)=0;

dbms_output.put_line(c_id);

commit;

exit when c_1%notfound;

end loop;

close c_1;

end clearTypes;

摘自 厚脸皮的tomsu的博客