Previous Topic

Next Topic

Alter Sequence

Valid in: SQL, ESQL

The Alter Sequence statement changes sequence settings that were specified when the sequence was created.

Previous Topic

Next Topic

Syntax

The Alter Sequence syntax has the following format:

[EXEC SQL] ALTER SEQUENCE [schema.]sequence_name [sequence_options]

Previous Topic

Next Topic

Permissions

You must have "create_sequence" privileges. You must also have the "next" privilege to retrieve values from a defined sequence. For information on the "next" privilege, see Grant (privilege).

Previous Topic

Next Topic

Locking and Sequences

In applications, sequences use logical locks that allow multiple transactions to retrieve and update the sequence value while preventing changes to the underlying sequence definition. The logical lock is held until the end of the transaction.

Previous Topic

Next Topic

Related Statements

Create Sequence

Drop Sequence

Previous Topic

Next Topic

Examples: Alter Sequence

The following examples change sequence settings that were specified when the sequence was created:

  1. Change the start value so that sequence "XYZ" starts at sequence item 10.

    alter sequence XYZ restart with 10

  2. Change the increment value of sequence "XYZ" to 20.

    alter sequence XYZ increment by 20


© 2007 Ingres Corporation. All rights reserved.