前两天写了这样一个东西,把一张把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

本文介绍了一个Oracle存储过程中的问题,当游标在SELECT时遇到无数据的情况会自动抛出错误并终止循环。作者提供了包含循环和异常处理的代码,并询问如何在SELECT未找到数据时继续执行下一次循环。
最低0.47元/天 解锁文章
541

被折叠的 条评论
为什么被折叠?



