Library Version 12.1.6.0

Chapter 11. The DB_SEQUENCE Handle
Prev |  | Next

## Chapter 11. The DB_SEQUENCE Handle

Sequences provide an arbitrary number of persistent objects that return an increasing or decreasing sequence of integers. Opening a sequence handle associates it with a record in a database. The handle can maintain a cache of values from the database so that a database update is not needed as the application allocates a value.

A sequence is stored as a record pair in a database. The database may be of any type, but must not have been configured to support duplicate data items. The sequence is referenced by the key used when the sequence is created, therefore the key must be compatible with the underlying access method. If the database stores fixed-length records, the record size must be at least 64 bytes long.

You create a sequence using the db_sequence_create method.

For more information on sequences, see the Berkeley DB Programmer's Reference Guide guide.

## Sequences and Related Methods

Sequences and Related Methods | Description
--- | ---
db_sequence_create | Create a sequence handle
DB_SEQUENCE->close() | Close a sequence
DB_SEQUENCE->get() | Get the next sequence element(s)
DB_SEQUENCE->get_dbp() | Return a handle for the underlying sequence database
DB_SEQUENCE->get_key() | Return the key for a sequence
DB_SEQUENCE->initial_value() | Set the initial value of a sequence
DB_SEQUENCE->open() | Open a sequence
DB_SEQUENCE->remove() | Remove a sequence
DB_SEQUENCE->stat() | Return sequence statistics
DB_SEQUENCE->stat_print() | Print sequence statistics
Sequences Configuration
DB_SEQUENCE->set_cachesize(), DB_SEQUENCE->get_cachesize() | Set/get the cache size of a sequence
DB_SEQUENCE->set_flags(), DB_SEQUENCE->get_flags() | Set/get the flags for a sequence
DB_SEQUENCE->set_range(), DB_SEQUENCE->get_range() | Set/get the range for a sequence

Prev |  | Next
DB_TXN->set_commit_token() | Home | db_sequence_create