New versions: Dev (3.15) | Latest (3.14) | 3.13 | 3.12 | 3.11 | 3.10 | 3.9 | 3.8 | Old versions: 3.7 | 3.6 | 3.5 | 3.4 | 3.3

Sequences and serials

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

Sequences implement the org.jooq.Sequence interface, providing essentially this functionality:

// Get a field for the CURRVAL sequence property
Field<T> currval();

// Get a field for the NEXTVAL sequence property
Field<T> nextval();

So if you have a sequence like this in Oracle:


You can then use your generated sequence object directly in a SQL statement as such:

// Reference the sequence in a SELECT statement:
Field<BigInteger> s = S_AUTHOR_ID.nextval();
BigInteger nextID =;

// Reference the sequence in an INSERT statement:
      .values(S_AUTHOR_ID.nextval(), val("William"), val("Shakespeare"))
  • For more information about generated sequences, refer to the manual's section about generated sequences
  • For more information about executing standalone calls to sequences, refer to the manual's section about sequence execution


Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo