I want to alter a db2 identity to cycle cache and to make it (re)start with a specific value, something like:
ALTER TABLE ALTER COLUMN
SET GENERATED ALWAYS AS IDENTITY (CYCLE CACHE 100) RESTART WITH 32323
Is there a way of doing this so that I can add cycle cache as well as make it restart from a specific number?
What error are you seeing? What version and platform of DB2?
The following works on DB2 for IBM i 7.1
alter table mytable
alter column mycolumn
set generated always
set cycle
set cache 100
restart with 32323
This worked also
alter table mytable
alter column mycolumn
set generated always as identity
set cycle
set cache 100
restart with 32323