Sequence FYI :
  • Managed By Oracle Server.
  • Implicitly handles locking mechanisms.
  • Allow generating rows with an unique number in a table.
  • By default it generates numeric values, which can be be converted with a business logic.
  • Can be casted as a PRIMARY KEY  of a table.
  • Prior to 11g release, a sequence value must be fetched through a SELECT statement in a memory variable as shown in
  • Use during multiple-transactions is not advised. Read more about SEQUENCE GAPPING, a condition happens during a transactions-roll-back, the sequence number generated by the sequence generator in a table, would be lost and can't retreived.
  • An user must possess CREATE SEQUENCE system privilege to create a sequence.
In Oracle PL/SQL, NEXTVAL and CURRVAL are the two pseudo columns in Oracle which are used to access the sequence values. NEXTVAL generates the new value of the sequence while CURRVAL displays the current value of the sequence.
Oracle PL/SQL uses pseudo-columns, namely, NEXTVAL and CURVAL to access the sequence values. As the name goes, NEXTVAL generates a new value and CURVAL shows the current numeric value of a defined sequence.