ITPub博客

首页 > 数据库 > Oracle > Oracle 游标

Oracle 游标

原创 Oracle 作者:guifx027 时间:2010-11-05 22:52:09 0 删除 编辑
Create or replace procedure p_test(ai_errorcode out integer, ai_errortext out varchar)
as
cursor cur_tabname is
Select * From tabname;

rec_tabname tabname%rowtype;
BEGIN
ai_errorcode := 1;
ai_errortext := 'OK';

open cur_tabname;
loop
<>
fetch cur_tabname into rec_tabname;
exit when cur_tabname%notfound;

--此处为要在游标里执行的语句块
Select Count(*) Into li_count From tabname Where 1=1;
if ll_count > 0 then
goto loopcontinue;
Else
--处理语句
END IF;
END LOOP;
CLOSE cur_tabname;

Return;

END p_test;
[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10018906/viewspace-1040990/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    54
  • 访问量
    43981