Library Version 12.1.6.0

Sequence Support in the SQL Layer
Prev | Chapter 11. Upgrading Berkeley DB 11.2.5.1 applications to Berkeley DB 11.2.5.2 | Next

## Sequence Support in the SQL Layer

A partial implementation of the sequence API defined in the SQL 2003 specification has been added to the SQL layer. A sequence is created using the syntax:

    SELECT create_sequence("sequence_name"...)

The sequence numbers are accessed using

    SELECT nextval("sequence_name")

and

    SELECT currval("sequence_name")

Finally, a sequence can be dropped using

    SELECT drop_sequence("sequence_name")

### New Functions

The four new functions, which have to be called as part of a `SELECT` statement, are describe in more detail in Using Sequences in the Berkeley DB Getting Started with the SQL APIs guide.

- create_sequence
- seq_nextval
- seq_currval
- seq_drop_sequence.

Prev | Up | Next
Repmgr Message Channels | Home | Berkeley DB X/Open Compliant XA Resource Manager