Table with "Identity column" as PK returns Duplicate key after adding a column.
Posted: Tue May 14, 2024 12:49 am
I'm experimenting with the "Identity column" field. The generated column looks like this:
I had a table with some data which needed an extra column.
After adding the field and checking it into the IBM i, every insert kept returning a IO$STS = VE. Joblogs said there was a duplicate key.
Only after clearing data with a CLRPFM, the table started accepting new records.
Am I missing something? Or is clearing the table the only way in these cases?
Code: Select all
CREATE TABLE DEVLIB/VBSTRG (
TRGID BIGINT GENERATED ALWAYS AS IDENTITY (
START WITH 1 INCREMENT BY 1
NO MINVALUE NO MAXVALUE
NO CYCLE NO ORDER
CACHE 20 )
. . . After adding the field and checking it into the IBM i, every insert kept returning a IO$STS = VE. Joblogs said there was a duplicate key.
Only after clearing data with a CLRPFM, the table started accepting new records.
Am I missing something? Or is clearing the table the only way in these cases?