8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 19:23:02 +01:00

Improvement CORE-4206 - Add RESTART [WITH] clause for alter identity columns - documentation.

This commit is contained in:
asfernandes 2013-09-05 16:09:25 +00:00
parent eae91e94a9
commit b0595b76aa

View File

@ -13,6 +13,9 @@ Syntax:
<column definition> ::= <column definition> ::=
<name> <type> GENERATED BY DEFAULT AS IDENTITY [ (START WITH <value>) ] <constraints> <name> <type> GENERATED BY DEFAULT AS IDENTITY [ (START WITH <value>) ] <constraints>
<alter column definition> ::=
<name> RESTART [ WITH <value> ]
Syntax rules: Syntax rules:
- The type of an identity column must be an exact number type with zero scale. That includes: - The type of an identity column must be an exact number type with zero scale. That includes:
smallint, integer, bigint, numeric(x, 0) and decimal(x, 0). smallint, integer, bigint, numeric(x, 0) and decimal(x, 0).
@ -42,10 +45,26 @@ insert into objects (name) values ('Table');
insert into objects (name) values ('Book'); insert into objects (name) values ('Book');
insert into objects (id, name) values (10, 'Computer'); insert into objects (id, name) values (10, 'Computer');
select * from objects; select * from objects order by id;
commit;
ID NAME ID NAME
============ =============== ============ ===============
1 Table 1 Table
2 Book 2 Book
10 Computer 10 Computer
alter table objects
alter id restart with 14;
insert into objects (name) values ('Pencil');
select * from objects order by id;
ID NAME
============ ===============
1 Table
2 Book
10 Computer
15 Pencil