create or replace procedure wmc
is
/*
定义变量
*/
tbid TB_SEED_INFO.SEED_ID%type;
tbcontent TB_SEED_INFO.Seed_Content%type;
tbdate TB_SEED_INFO.Data_Date%type;
/*
定义一个游标mycur
*/
cursor mycur is
select t.seed_id tbid,t.seed_content tbcontent,t.data_date tbdate from TB_SEED_INFO t;
begin
/*
循环游标,更新表
*/
open mycur;
loop
fetch mycur into tbid,tbcontent,tbdate;
exit when mycur%notfound;
update TB_SEED_INFO u set u.seed_content='88888' where u.seed_id=tbid;
end loop;
end;
一个简单的oracle存储过程(游标循环)
最新推荐文章于 2021-04-10 21:51:34 发布