ORA-01436: CONNECT BY loop in user data

ORA-01436: CONNECT BY loop in user data

when we execute a hierarchical query, it throws an error as ORA-01436 due to data present is not matched and caused error:

Error

select empno, ename, sys_connect_by_path(ename,' -> ') tree from emp connect by prior empno=mgrno;
ORA-01436: CONNECT BY loop in user data

Solution
To trace this error of Connect by loop using connect_by_iscycle, we may execute following query:

select emp.*, connect_by_iscycle from emp where connect_by_iscycle = 1 connect by nocycle prior empno=mgrno;

It will give you the fault rows.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s