GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL Plus
Go To First  |  Previous Question  |  Next Question 
 SQL Plus  |  Question 29 of 132    Print  
What is CYCLE/NO CYCLE in a Sequence

Answer posted by Scott on 2005-05-25 18:39:48: When you create a sequence with CYCLE option, you are saying that when the sequence reaches its MAXVALUE, it will start over at the MINVALUE. This is not wise if using the sequence for primary key creation. 
 
When you create a sequence with NOCYCLE option, you are saying that when the sequence reaches its MAXVALUE, it will NOT start over at the MINVALUE. This option is safest if using the sequence for primary key creation. When the sequence reaches its MAXVALUE an oracle error is thrown.



  
Total Answers and Comments: 2 Last Update: May 26, 2006   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
May 25, 2005 18:39:48   #1  
Scott        

RE: What is CYCLE/NO CYCLE in a Sequence
When you create a sequence with CYCLE option you are saying that when the sequence reaches its MAXVALUE it will start over at the MINVALUE. This is not wise if using the sequence for primary key creation.

When you create a sequence with NOCYCLE option you are saying that when the sequence reaches its MAXVALUE it will NOT start over at the MINVALUE. This option is safest if using the sequence for primary key creation. When the sequence reaches its MAXVALUE an oracle error is thrown.

 
Is this answer useful? Yes | No
May 26, 2006 01:40:01   #2  
inam Member Since: May 2006   Contribution: 1    

RE: What is CYCLE/NO CYCLE in a Sequence

when a sequence is created with CYCLE option this mean that when a sequence reaches its MAXVALUE it will start over at the MINVALUE. The CYCLE option is not wise for the primary key column.

And when a sequence is created with NOCYCLE option this mean that when the sequence reaches its MAXVALUE it will not start over at the MINVALUE but an error is generated by the oracle server.

Note: Because CYCLE/NOCYCLE value is optional When no option is defined the default value will NOCYCLE.


 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : select .nextval from dual;select .currval from dual;orselect * from user_sequences where sequence_name = ;here last_number is your currval and last_number + increment_by is your nextval ...

Answer posted by Scott on 2005-05-25 18:39:48: When you create a sequence with CYCLE option, you are saying that when the sequence reaches its MAXVALUE, it will start over at the MINVALUE. This is not 
Latest Answer : when a sequence is created with CYCLE option, this mean that when a sequence reaches its MAXVALUE, it will start over at the MINVALUE. The CYCLE option is not wise for the primary key column.And when a sequence is created with NOCYCLE option, this ...

How to access the current value and next value from a sequence ? Is it possible to access the current value in a session before accessing next value ?
Sequence name CURRVAL, Sequence name NEXTVAL.It is not possible. Only if you access next value in the session, current value can be accessed. 

CYCLE specifies that the sequence continues to generate values after reaching either maximum or minimum value. After pan ascending sequence reaches its maximum value, it generates its 
Latest Answer : No cycle:  after reaching to max val sequence will not give nextvalcycle     after reaching to max val sequence will restart with startwith option vlues ...


 Sponsored Links

 
Related Articles

Querying Data with Oracle XQuery

Querying Data with Oracle XQuery Starting with Oracle Database 10g Release 2 you can take advantage of a full featured native XQuery engine integrated with the database With Oracle XQuery you can accomplish various tasks involved in developing PHP Oracle XML applications operating on any kind of dat
 

Using Oracle XML DB Repository

Using Oracle XML DB Repository Another variation on accessing and manipulating XML content stored in Oracle database is provided by Oracle XML DB repository which is an essential component of Oracle XML DB mosgoogle NOTE Oracle XML DB repository also known as XML repository is a hierarchically organ
 

Using Oracle Database for Storing, Modifying, and Retrieving XML Data

Using Oracle Database for Storing Modifying and Retrieving XML Data With Oracle XML DB you have various XML storage and XML processing options allowing you to achieve the required level of performance and scalability One of the most interesting things about Oracle XML DB is that it allows you to per
 

XML Processing in PHP and Oracle Applications

Processing XML in PHP Oracle Applications As mentioned there are two alternatives when it comes to performing XML processing in your PHP Oracle application You can perform any required XML processing using either PHP s XML extensions or PEAR XML packages or Oracle s XML features mosgoogle In the fol
 

PHP Oracle Web Development

PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax The book is written by Yuli Vaseliev a well known author of different web development and programming books PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax is a good starting b
 

Getting Started with Oracle and ODP.NET

ODP NET Developer’ s Guide by Jagadish Chatarji Pulakhandam Sunitha Paruchuri A practical guide for developers working with the Oracle Data Provider for NET and the Oracle Developer Tools for Visual Studio 2005 Application development with ODP NET Dealing with XML DB using ODP NET Oracle
 

PHP Oracle Web Development Review

PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax The book is written by Yuli Vaseliev a well known author of different web development and programming books The author is also an expert in open source technologies and SOA Service Oriented Architecture But besides
 

Step by Step Oracle PL-SQL Tutorial

This introductory tutorial to PL SQL will help you to understand the basic concepts of PL SQL Please review the following tutorials and practice the sample SQL Statements on your local Oracle Database Please note that you must learn these basic things before we actually start getting in to Advanced
 

Working with XML in Oracle

Working with XML in Oracle Introduction to XML Extensive markup language is the language which presents data in a human readable form of text The data can be anything from a purchase order or a stock quote or weather radar or a flight schedule it can be represented using XML XML is very similar to H
 

What is Oracle Net Service

Oracle Net Services provides enterprise-wide connectivity solutions in distributed, heterogeneous computing environments. Oracle Net Services eases the complexities of network configuration and management, maximizes performance, and improves network diagnostic capabilities. Oracle Net, a component
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape