Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

Sequence Values

Sequence values in SQL statements can be referred as follows:

  • CURRVAL: Returns the current value of a sequence
  • NEXTVAL: Increments the sequence and returns the next value

You must qualify CURRVAL and NEXTVAL with the name of the sequence, for example:

  • sequence.CURRVAL
  • sequence.NEXTVAL


select mysequence.nextval;

insert into mytable values (mysequence.nextval, 'aaa');