Answer Posted / gvmahesh
NOCYCLE keyword is default in sequences.
CYCLE :If we want use cycle keyword first we check the table
having primary key or not.If there is no primary key we
absolutely use the CYCLE keyword.
In hierarchical structure,the descendant act as a
ancestor,is called CYCLE.
For eliminating ancestor descendant problem we use NOCYCLE
KEYWORD.
for example we take the EMP table
In EMP table the MGR column has a NULL managerial number.In
that column we insert some of the empno.Then ancestor
descendant problem occur.
select * from emp;
update emp set mgr=7566 where mgr is null;
Then we write a hierarchical query
select empno,ename,sal,mgr from emp
start with ename='KING'
connect by prior empno=mgr;
we execute this query it shows an error
ERROR:
ORA-01436: CONNECT BY loop in user data.
in this situation also we want to see the data through
NOCYCLE keyword.
select empno,ename,sal,mgr from emp
start with ename='KING'
connect by NOCYCLE prior empno=mgr;
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
what is collation? : Sql dba
which command using query analyzer will give you the version of sql server and operating system? : Sql dba
What is trigger in pl sql with examples?
What is not null in sql?
what are string data types? : Sql dba
What is the use of function in sql?
What are tables and fields?
how to install mysql? : Sql dba
Can we write ddl statements in functions?
How we can update the view?
What are the different types of dbms?
What view means?
Is there a pl/sql pragma similar to deterministic, but for the scope of one single sql select?
What is mdf ldf and ndf?
What is linq to sql?