Firebird Documentation Index → Firebird 2.0 Language Ref. Update → DDL statements → 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 SEQUENCEsequence-name
RESTART WITH<newval>
<newval>
::= A signed 64-bit integer value.
Example:
alter sequence seqtest restart with 0
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: CREATE SEQUENCE
Firebird Documentation Index → Firebird 2.0 Language Ref. Update → DDL statements → ALTER SEQUENCE |