在我的表中,我有一列 MODIFIED 类型为 TIMESTAMP。我想在更新行时自动更新此列
我可以将其用于新列
alter table my_table add column last_updated timestamp not null
generated by default for each row on update as row change timestamp
但我不能用它来编辑现有的列来自动更新
alter table my_table alter column modified set data type timestamp
not null generated by default for each row on update as row change timestamp
我是否正确使用了改变?
错误信息是
Error: DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=alter table my_table alter column modified;BEGIN-OF-STATEMENT;<values>, DRIVER=3.50.152
SQLState: 42601
ErrorCode: -104