Gaurav Malviya
What is CYCLE/NO CYCLE in a Sequence?
By Gaurav Malviya in SQL Server on Jan 14 2014
  • Khan Abrar Ahmed
    May, 2014 8

    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.

    • 0
  • Gaurav Malviya
    Jan, 2014 14

    CYCLE specifies that the sequence continue to generate values after reaching either maximum or minimum value. After pan-ascending sequence reaches its maximum value, it generates its minimum value. After a descending sequence reaches its minimum, it generates its maximum. 
    NO CYCLE specifies that the sequence cannot generate more values after reaching its maximum or minimum value.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS