cancel
Showing results for 
Search instead for 
Did you mean: 

DB2 for z/OS table is dropped when a row change timestamp column is added

former_member616310
Discoverer
0 Kudos

hi,

I have the following problem.

when adding a column with the following attributes:

NOT NULL GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP


powerdesigner drops the table and then recreates it with row change timestamp column.


however it should create something like

ALTER TABLE tablename

ADD COLUMN columnname TIMESTAMP GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP;


I am using Powerdesigner version 16.5, how can I make powerdesigner generate such script?


thanks,

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member616310
Discoverer
0 Kudos
former_member200945
Contributor
0 Kudos

Powerdesigner engine has some rules to prevent an alter statement from generating.

The purpose of these rules is for data protection, prevent a user from accidentally modifying data

in database. Two of the rules are

1) Set the new column as not null

2) Move the new column up (by default, the new column always be last position)

Please apply the rules in your model.

Ondrej_Divis
Contributor

Hi Phillip, I was wondering if you could share all the rules that affect decision whether to use drop&create or alter command. I was not able to find this in documentation and many customers are asking me this.

Thank you,

Ondrej