Monday, 7 July 2014

Insert and Delete Errors - SQL0668N Operation not allowed for reason code 7

Insert and Delete Errors - SQL0668N Operation not allowed for reason code 7

How you do when you cannot insert or delete data in some tables

A - Errors

db2inst1@db2:~/scripts> db2 "delete from tab1 where col1=1"
DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0668N  Operation not allowed for reason code "7" on table
"DB2INST1.tab1".  SQLSTATE=57016

B - Invetigation

db2 " ? SQL0668N "

....

 7 The table is in the reorg pending state. This can occur after
an ALTER TABLE statement containing a REORG-recommended
operation.

....



C - Resolution

      Reorganize the table using the REORG TABLE command (note that INPLACE REORG TABLE is not allowed for a table that is in the reorg pending state.
db2 "reorg table DB2INST1.tab1"

D - POSSIBLE CAUSES

  • When columns are dropped

No comments:

Post a Comment