Start of changeStart of change

-669   THE OBJECT CANNOT BE EXPLICITLY DROPPED. REASON reason-code

Explanation

The DROP statement failed.

reason-code
The reason for the message or SQL code, indicated by one of the following values:
0001
One of the following statements attempted to drop a table that resides in an explicitly defined partitioned table space or a partition-by-growth table space:
  • The DROP TABLE statement
  • A DROP statement which causes a dependent table to be dropped
0002
The DROP INDEX statement attempted to drop an index that DB2® requires to retain the following conditions:
  • The primary key constraint on a table
  • A unique key constraint on a table
  • A referential constraint on a table
  • The uniqueness of a ROWID column
  • An XML column defined on a table

A system required index cannot be dropped using the DROP INDEX statement.

0003
The DROP INDEX statement attempted to drop an implicitly created index for a table that is defined with HASH organization.
0004
The DROP TABLE statement attempted to drop a table that was implicitly created for an XML column.
0005
The DROP TABLESPACE statement attempted to drop a table space that was implicitly created for a table containing an XML column.
0006
The DROP statement attempted to drop an auxiliary table, an auxiliary index, or an auxiliary table space that is involved in cloning.
0007
The DROP TABLESPACE statement or DROP DATABASE statement attempted to drop a table space or database that contains an accelerator-only table.

System action

The statement cannot be processed. The object is not dropped.

Programmer response

Take the appropriate corrective action based on the reason-code value:

0001
The table of a partitioned table space can be dropped implicitly only when the table space itself is dropped.
0002
If you do not want to keep the primary key, unique key, or referential constraint, use the DROP CONSTRAINT clause of the ALTER TABLE statement to remove the primary key or unique constraint. If the index was created only for enforcing the primary or unique key, the index will be dropped. If not, the DROP INDEX statement could then be processed. An index for a ROWID column can only be dropped by dropping the table.
0003
The index can only be dropped implicitly when the associated table that contains the XML column is dropped. If the error is about a table that is organized by hash, then the associated hash overflow index cannot be dropped. Dropping hash organization will automatically drop the hash overflow index.
0004
The table can be dropped implicitly only when the associated table containing the XML column is dropped.
0005
The table space can be dropped implicitly only when the associated table containing the XML column is dropped.
0006
An auxiliary table, an auxiliary index, or an auxiliary table space that is involved in cloning can be dropped implicitly only when the associated table containing the XML column is dropped.
0007
The table space or database can be dropped explicitly only when the accelerator-only table is dropped.

SQLSTATE

42917

End of changeEnd of change