暂无图片
oracle 存储过程游标查询为空, 怎么写让其结束存储过程 而不执行后面的dml逻辑?
我来答
分享
热血青年
2021-12-22
oracle 存储过程游标查询为空, 怎么写让其结束存储过程 而不执行后面的dml逻辑?

oracle 存储过程游标查询为空, 怎么写让其结束存储过程 而不执行后面的dml逻辑?

我来答
添加附件
收藏
分享
问题补充
3条回答
默认
最新
DarkAthena

描述不完整,建议上代码看看

暂无图片 评论
暂无图片 有用 0
刘晓华

基本的东西,建议先找本Oracle PL/SQL的书来看看吧

暂无图片 评论
暂无图片 有用 0
Thomas

declare
cursor ca is select code from tb_city_basic where province='AMS';
xx tb_city_basic.code%type;
begin
open ca;
fetch ca into xx;
if ca%found then
dbms_output.put_line('cursor');
dbms_output.put_line('not empty');
end if;
end;
/

PL/SQL procedure successfully completed.

declare
cursor ca is select code from tb_city_basic where province='新疆';
xx tb_city_basic.code%type;
begin
open ca;
fetch ca into xx;
if ca%found then
dbms_output.put_line('cursor');
dbms_output.put_line('not empty');
end if;
end;
/
cursor
not empty


第一种是CURSOR为空的情况,第二种是非空的

暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏