I am trying to alter a table. Able to alter the table & after that I performed the REORG. It is working & now I am trying to update the same table.This is the error which I am getting. can some one help me with this.These are the steps which I am following:
alter table test2 add column id integer not null with default 0
alter table test2 alter id drop default
alter table test2 alter id set generated always as identity
REORG TABLE TEST2
update test2 set ID = default
error after the update stmt:
DB2 SQL Error: SQLCODE=-1822, SQLSTATE=560BD, SQLERRMC=-668;SAMPLE; SQL0668N Operation not allowed for reason code "7" on ta, DRIVER=4.17.30
Run of routine failed.
even REORG is happening. when updating it is throwing some error.These are the steps which I am running inside a stored procedure.
According to my understanding the table is going to reorganize pending state. can some one suggest me how to solve this issue.
Your example is not reproducible.
Which db2 version do you use?
Run the following statements which return no errors as is or provide your own full example which returns the error.
create table test2 (a int) in userspace1;
insert into test2 values 1;
alter table test2 add column id integer not null with default 0;
alter table test2 alter id drop default;
alter table test2 alter id set generated always as identity;
REORG TABLE TEST2;
update test2 set ID = default;