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

    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;            

猜你喜欢

转载自www.cnblogs.com/doubleo2water/p/9544168.html