Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is CYCLE/NO CYCLE in a Sequence?

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


Please Help Members By Posting Answers For Below Questions

what is collation? : Sql dba

1130


which command using query analyzer will give you the version of sql server and operating system? : Sql dba

1035


What is trigger in pl sql with examples?

1016


What is not null in sql?

1031


what are string data types? : Sql dba

1018


What is the use of function in sql?

1067


What are tables and fields?

1012


how to install mysql? : Sql dba

1088


Can we write ddl statements in functions?

1090


How we can update the view?

1036


What are the different types of dbms?

993


What view means?

960


Is there a pl/sql pragma similar to deterministic, but for the scope of one single sql select?

1003


What is mdf ldf and ndf?

975


What is linq to sql?

1120