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