What is CYCLE/NO CYCLE in a Sequence?
Answers were Sorted based on User's Feedback
Answer / tulsi
NO CYCLE is default when sequence is created
CYCLE statement is given when the sequence has to repeat
its number generation between START WITH and MAX VALUE.
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / 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 |
How does index help in query performance?
How many types of relationship are there?
what is outer join? what is selef join? what is difference between them? what is cartecion join?
1 Answers Fiserv, Herbinger, Synechron,
What is program debugging?
What are all the different normalizations?
In table a 1lakh data is present,in table b 20 thousand data is present, to get unique data from table a and b which join to be considered. whether right outer join or left inner join.
Which is faster count (*) or count 1?
What is sql character function?
What are the different parts of a package?
What are the data types allowed in a table?
what are the 'mysql' command line options? : Sql dba
Explian rowid, rownum?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)