DB2 9.7 FP6 / AIX 6
I had a table with records to which I added a 'Generated Always' column.
the table has lot of RI Constraints defined on it.
Steps below:
At Step 3, i forced db2 to SET INTEGRITY 'without' checking.
Now when I want DB2 to SET INTEGRITY while checking all data, it returns an error.
Any suggestions to fix this.
Series of statements run:
Step 1
-------
db2 => SET INTEGRITY FOR DM.DIM_SITE OFF
DB20000I The SQL command completed successfully.
Step 2
------
db2 => ALTER TABLE DM.DIM_SITE ADD COLUMN SITE_NO_TRIM VARCHAR(10) GENERATED ALWAYS AS (SUBSTR(TRIM(SITE_NO),1,1))
DB20000I The SQL command completed successfully.
Step 3
------
db2 => SET INTEGRITY FOR DM.DIM_SITE ALL IMMEDIATE UNCHECKED
DB20000I The SQL command completed successfully.
Step 4
------
db2 => SET INTEGRITY FOR DM.DIM_SITE OFF
DB20000I The SQL command completed successfully.
Step 5
------
db2 => SET INTEGRITY FOR DM.DIM_SITE IMMEDIATE CHECKED NOT INCREMENTAL
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL3603N Integrity processing through the SET INTEGRITY statement has found
an integrity violation involving a constraint, a unique index, a generated
column, or an index over an XML column. The associated object is identified by
"DM.DIM_SITE.SITE_NO_TRIM". SQLSTATE=23514
I had a table with records to which I added a 'Generated Always' column.
the table has lot of RI Constraints defined on it.
Steps below:
At Step 3, i forced db2 to SET INTEGRITY 'without' checking.
Now when I want DB2 to SET INTEGRITY while checking all data, it returns an error.
Any suggestions to fix this.
Series of statements run:
Step 1
-------
db2 => SET INTEGRITY FOR DM.DIM_SITE OFF
DB20000I The SQL command completed successfully.
Step 2
------
db2 => ALTER TABLE DM.DIM_SITE ADD COLUMN SITE_NO_TRIM VARCHAR(10) GENERATED ALWAYS AS (SUBSTR(TRIM(SITE_NO),1,1))
DB20000I The SQL command completed successfully.
Step 3
------
db2 => SET INTEGRITY FOR DM.DIM_SITE ALL IMMEDIATE UNCHECKED
DB20000I The SQL command completed successfully.
Step 4
------
db2 => SET INTEGRITY FOR DM.DIM_SITE OFF
DB20000I The SQL command completed successfully.
Step 5
------
db2 => SET INTEGRITY FOR DM.DIM_SITE IMMEDIATE CHECKED NOT INCREMENTAL
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL3603N Integrity processing through the SET INTEGRITY statement has found
an integrity violation involving a constraint, a unique index, a generated
column, or an index over an XML column. The associated object is identified by
"DM.DIM_SITE.SITE_NO_TRIM". SQLSTATE=23514