ALTER SEQUENCE

<< | FB 2.5 Language Reference | >>
<< | FB 2.1 Language Reference | >>
<< | FB 2.0 Language Reference | >>

ALTER SEQUENCE

Available in: DSQL

Added in: 2.0

Description

(Re)initializes a sequence or generator to the given value. SEQUENCE is the SQL-compliant term for what InterBase and Firebird have always called a generator. ALTER SEQUENCE ... RESTART WITH is fully equivalent to SET GENERATOR ... TO and is the recommended syntax from Firebird 2.0 onward.

Syntax

 ALTER SEQUENCE sequence-name RESTART WITH <newval>

 <newval> ::= A signed 64-bit integer value.

Example

 alter sequence seqtest restart with 0

Warning: Careless use of ALTER SEQUENCE is a mighty fine way of screwing up your database! Under normal circumstances you should only use it right after CREATE SEQUENCE, to set the initial value.

See also:
SET GENERATOR
CREATE SEQUENCE
DROP SEQUENCE
NEXT VALUE FOR
DDL - Data Definition Language

back to top of page
<< | FB 2.5 Language Reference | >>
<< | FB 2.1 Language Reference | >>
<< | FB 2.0 Language Reference | >>