CREATE TABLE "ABC".table1 (
ts TIMESTAMP NOT NULL GENERATED ALWAYS FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP,
part INTEGER GENERATED ALWAYS AS (month(ts))
but getting following error
Error:8/20/2012 10:36:41 PM 0:00:02.250: DB2 Database Error: ERROR  [IBM][DB2/AIX64] SQL0548N A check constraint or generated column that is defined with "PART" is invalid. SQLSTATE=42621.
could anyone please help me out to resolve this error??
The message text seems clear (from db2 ? SQL0548N)
* the definition contains a reference to a generated column which is
based on an expression
* the check constraint is part of a column definition, and its
check-condition contains a reference to a column name other than th
column being defined