Log Analyzer UNDO file UPDATE statements incomplete for GENERATED ALWAYS TIMESTAMP column.
search cancel

Log Analyzer UNDO file UPDATE statements incomplete for GENERATED ALWAYS TIMESTAMP column.

book

Article ID: 131327

calendar_today

Updated On:

Products

Log Analyzer for DB2 for z/OS

Issue/Introduction

Creating UNDO SQL file using Log Analyzer for Db2 for z/OS (PLA).

The UNDO SQL file has incomplete UPDATE statements as in the 
following example where the SET contains no value:

UPDATE creator.tablename 
SET 
WHERE COL1 = 12345678
AND COL2 = 123456


The table DDL shows that DATA CAPTURE CHANGES in enabled.

One item in common where the SET COLUMN = VALUE is not generated
is after a column was ALTER added with the following definition: 

,COL3 TIMESTAMP (6) WITHOUT TIME ZONE NOT NULL 
GENERATED ALWAYS 
FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP 

Resolution

Analysis shows that an UPDATE of the table replacing column(s) with
the same value(s) already in the row is causing Db2 to modify the
GENERATED ALWAYS ROW CHANGE TIMESTAMP column but nothing
else is logged which PLA can utilize to format the UPDATE DML.

PLA is working as designed in this scenario.  Updating a row
with the exact column data already present in the row would not appear
to be a common occurrence.  Recommendation is to comment out
the SQL statements with the empty SET clause to resolve.