# SYSSEQUENCES system table

The SYSSEQUENCES table describes the sequence generators in the database.

Note: Users should not directly query the SYSSEQUENCES table, because that will slow down the performance of sequence generators. Instead, users should call the SYSCS_UTIL.SYSCS_PEEK_AT_SEQUENCE system function.

The following table shows the contents of the SYSSEQUENCES system table.

Table 1. SYSSEQUENCES system table
Column Name | Type | Length | Nullable | Contents
--- | --- | --- | --- | ---
SEQUENCEID | CHAR | 36 | false | The ID of the sequence generator. This is the primary key.
SEQUENCENAME | VARCHAR | 128 | false | The name of the sequence generator. There is a unique index on (SCHEMAID, SEQUENCENAME).
SCHEMAID | CHAR | 36 | false | The ID of the schema that holds the sequence generator. There is a foreign key linking this column to SYSSCHEMAS.SCHEMAID.
SEQUENCEDATATYPE | org.apache.derby. catalog. TypeDescriptor This class is not part of the public API. | 2,147,483,647 | false | System type that describes the precision, length, scale, nullability, type name, and storage type of the data
CURRENTVALUE | BIGINT | 20 | true | The current value of the sequence generator. This is not the actual next value for the sequence generator. That value can be obtained by calling the system function SYSCS_UTIL.SYSCS_PEEK_AT_SEQUENCE. SYSSEQUENCES.CURRENTVALUE holds the end of the range of values which have been preallocated in order to boost concurrency. The initial value of this column is STARTVALUE. This column is NULL only if the sequence generator is exhausted and cannot issue any more numbers.
STARTVALUE | BIGINT | 20 | false | The initial value of the sequence generator
MINIMUMVALUE | BIGINT | 20 | false | The minimum value of the sequence generator
MAXIMUMVALUE | BIGINT | 20 | false | The maximum value of the sequence generator
INCREMENT | BIGINT | 20 | false | The step size of the sequence generator
CYCLEOPTION | CHAR | 1 | false | If the sequence generator cycles, this value is 'Y'. If the sequence generator does not cycle, this value is 'N'.

Parent topic: Derby system tables
Related reference
SYSCS_UTIL.SYSCS_PEEK_AT_SEQUENCE system function
CREATE SEQUENCE statement
DROP SEQUENCE statement
derby.language.sequence.preallocator