Start of change

-20181   COLUMN CANNOT BE ADDED TO INDEX index-name

Explanation

An attempt was made to add a column to an index, but the column could not be added.

index-name
The name of the index.

The column could not be added because of limitations on the clause specified for the ALTER INDEX statement:

ALTER INDEX ADD COLUMN
The column cannot be added for any of a variety of reasons, including those shown below:
  • The index is an auxiliary index.
  • The index enforces uniqueness of values for a ROWID column.
  • The index is a partitioning index, and index-based partitioning is being used.
  • The index is an XML index.
  • The index is an extended index.
  • The index is defined with a period with the WITHOUT OVERLAPS clause.
  • The index has at least one INCLUDE column.
  • Start of changeThe index enforces a primary key, unique key, or referential constraint, or it matches a foreign key.End of change
ALTER INDEX ADD INCLUDE
The column cannot be added for any of a variety of reasons, including those shown below:
  • The index is an auxiliary index.
  • The index is a non-unique index.
  • The index is a partitioning index, and index-based partitioning is being used.
  • The index is an XML index.
  • The index is an extended index (such as an expression-based index).
  • The index is defined with a period with the WITHOUT OVERLAPS clause.
  • The index matches a foreign key.

System action

The statement cannot be processed.

Programmer response

Change the statement to refer to an index that can have a column added to it, or drop and re-create the index, including all of the required columns.

SQLSTATE

428FS

End of change