Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01436: CONNECT BY loop in user data, but CONNECT_BY_ISCYCLE is all ZERO

672680Feb 17 2011 — edited Feb 21 2011
hi,

when I run below query, it always throws error below:
SELECT connect_by_root code AS code_root,
    CODE,
    CODE_DESC,
    UP_CODE 
  FROM DI_CODE_LEVEL
  WHERE TYPE_CODE='SP'
    CONNECT BY PRIOR CODE=UP_CODE;

ORA-01436: CONNECT BY loop in user data
01436. 00000 -  "CONNECT BY loop in user data"
But when I use NOCLYCLE and CONNECT_BY_ISCYCLE to find out which row is in question,
it shows nothing, which means CONNECT_BY_ISCYCLE=ZERO for all rows.
select * from (
    SELECT connect_by_root code AS code_root,
        CODE,
        CODE_DESC,
        UP_CODE ,
        CONNECT_BY_ISCYCLE AS ISCYCLE
      FROM DI_CODE_LEVEL
      WHERE TYPE_CODE='SP'
        CONNECT BY NOCYCLE PRIOR CODE=UP_CODE
    ) 
where ISCYCLE>0;
Is there any other reason that this sql would throw ORA-01436?
If there is a loop, then will the combination of NOCYCLE, CONNECT_BY_ISCYCLE will show?

Thanks
This post has been answered by Frank Kulash on Feb 18 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 21 2011
Added on Feb 17 2011
4 comments
3,725 views