Start of change

-151   THE UPDATE OPERATION IS INVALID BECAUSE THE CATALOG DESCRIPTION OF COLUMN column-name INDICATES THAT IT CANNOT BE UPDATED

Explanation

The requested function is not supported by DB2®.

column-name
The name of the column that could not be updated.

This error occurs if either:

  • The object column in an update operation is defined with the GENERATED ALWAYS and AS IDENTITY or AS ROW CHANGE TIMESTAMP attributes, its value is not being set with the DEFAULT keyword, and one of the following conditions is true:
    • Extended indicator variable values are not enabled.
    • Extended indicator variable values are enabled, but the value specified for the indicator variable is not the extended indicator variable-based values of DEFAULT or UNASSIGNED.
  • The object column is not updatable.

A column is not updatable for one or more of the following reasons:

  • The values for columns occurring in the partitioning key of a partitioned table cannot be updated.
  • The object table is a view and the specified column is defined (in the definition of the view) in such a way that it cannot be updated.
  • The object table is a catalog table with no columns that can be updated.
  • The object column is a ROWID column.
  • The specified column of catalog tables cannot be updated because the column itself is not updatable.
  • The values for columns occurring in the hash key of a table that is organized by hash cannot be updated.
  • The BUSINESS_TIME period in the table includes a column that was specified to be updated. A column of a BUSINESS_TIME period must not be modified within a trigger body.
  • The BUSINESS_TIME period in the table includes a column that was specified to be updated. A column of a BUSINESS_TIME period must not be modified if the data change statement includes a period clause.

Individual columns in a view cannot be updated for one of the following reasons:

  • The column is derived from an SQL function, an arithmetic expression, or a constant.
  • The column is defined for a column of an underlying view that cannot be updated.
  • The column is defined for a read-only view.
  • The column is defined for a column that is in the partitioning key of a partitioned table.

System action

The statement cannot be processed. No data was updated in the object table or view.

Programmer response

Correct the syntax and reissue the statement that included the update operation.

SQLSTATE

42808

End of change