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 |
what is the use of friend function? : Sql dba
source destination distance chennai bangalore 500 bangalore chennai 500 hyd delhi 1000 delhi hyd 1000 bangalore hyd 800 Here chennai to bangalore and bangalore to chennai is same distance. and hyd and delhi also same criteria. Based on the distance i want to display only one row using sql query?
What are properties of the transaction?
how to load data with out header and footer records in a database using sql*loader? pls tell me the answer urgently
What is a field in a database?
What is the file extension for sql database?
What is normalization? dec 2009
What is oracle and pl sql?
Explain aggregate functions are available there in sql?
What does varchar include?
how to escape special characters in sql statements? : Sql dba
Hello All, Could any well write a query for the following scenario. Account(table name) No Name Amount 1 ABCD 2000.00 2 DEFG -2000.00 3 GHIJ 3000.50 4 JKLM 4000.00 5 MNOP 6000.00 O/p Should be in this format No Name Credit Debit 1 ABCD 2000.00 0 2 DEFG 0 -2000.00 3 GHIJ 3000.50 4 JKLM 0 -4000.00 5 MNOP 6000.00 o could any one give appropriate query for this Thnks in Advance Suneel Reddy