首页 > 其他 > 详细

查找引发 ORA-01436: 用户数据中的 CONNECT BY 循环 错误的数据

时间:2018-08-27 19:44:16      阅读:306      评论:0      收藏:0      [点我收藏+]

 

    declare
            cursor orList is select  *  from t_org;
            topOrgID number;
    begin 
         for org in orgList loop
             begin 
                  select t.ORG_ID into topOrgID  from t_ORG t  where t.UP_ORG_ID = 0
                  start with t.ORG_ID = org.ORG_ID connect by prior t.UP_ORG_ID = t.ORG_ID
                  exception
                      when others then 
                            if SQLCODE = -1436 then   
                                dbms_out_put.put_line(‘错误信息:‘||SQLERRM || ‘;错误代码:‘||SQLCODE || ‘;错误机构:‘|| org.ORG_ID);
                            end if;
                          continue;
                   end;
          end loop;
     end;            

查找引发 ORA-01436: 用户数据中的 CONNECT BY 循环 错误的数据

原文:https://www.cnblogs.com/doubleo2water/p/9544168.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!