oracle游标select时没有数据会自动报错

本文介绍了一个Oracle存储过程中的问题,当游标在SELECT时遇到无数据的情况会自动抛出错误并终止循环。作者提供了包含循环和异常处理的代码,并询问如何在SELECT未找到数据时继续执行下一次循环。
摘要由CSDN通过智能技术生成

前两天写了这样一个东西,把一张把ciid为0的数据从另一张表找到imsi相同的时间相近的ciid添加进去,结果写到select的时候发现了这样一个问题,就是select要查不到数据的时候会自动报错,也就终止了循环,以下是改过后的代码,想请教下,如果select不到东西的时候我怎么跳到下一个select,if还是没数据的时候我直接continue到下一次循环?

create or replace procedure Proc_update_paging_ciid
(
setstarttime in date,
setendtime in date
)
as
begin
  declare
cursor LCID_cursor is select lacid, ciid,starttime,imsi from t_detail_cs_paging
where starttime>=setstarttime
and starttime<setendtime
and ciid = 0 order by starttime desc;

lac_ci_id_cursor LCID_cursor%rowtype;
v_ciid          t_detail_cs_pagingmo.ciid%type;
v_ciid1          t_detail_cs_pagingmo.ciid%type;
v_ciid2            t_detail_cs_pagingmo.ciid%type;
v_pagingmotime         date;
v_pagingtime            date;
v_number number(10);
begin
open LCID_cursor;
loop
  begin

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值