dynamobi/dynamobi — Issue #162: [LDB-160] ALTER TABLE .. REBUILD with "generated" column causes Exception
Author: dynamobi-build
Created: 2011-12-30 02:17:43+00:00
State: open
Labels: LDB

[reporter="ngoodman", created="Mon, 7 May 2007 11:42:42 -0500 (GMT-05:00)"]
With GENERATED ID column generates an Error:

create table DIM_CUSTOMER2 ( DIM_CUSTOMER_ID int generated always as identity not null primary key, DIM_CUSTOMER_NK int not null, LASTNAME varchar(10), FIRSTNAME varchar(15), ZIPCODE int, CITY varchar(15), BIRTHDATE date, STREET varchar(15), HOUSENUMBER int, STATE_CODE varchar(10), STATE varchar(20), unique (DIM_CUSTOMER_NK) );

alter table DIM_CUSTOMER2 rebuild;

Error: java.lang.UnsupportedOperationException: class java.lang.String: insert value into field which is always generated (state=,code=0)

Without GENERATED column:

create table DIM_CUSTOMER3 ( DIM_CUSTOMER_ID int not null primary key, DIM_CUSTOMER_NK int not null, LASTNAME varchar(10), FIRSTNAME varchar(15), ZIPCODE int, CITY varchar(15), BIRTHDATE date, STREET varchar(15), HOUSENUMBER int, STATE_CODE varchar(10), STATE varchar(20), unique (DIM_CUSTOMER_NK) );

alter table DIM_CUSTOMER3 rebuild;

No rows affected (2.346 seconds)

Error occurs with and without data in DIM_CUSTOMER2 table.