求助,db2对有主键和约束的表删除列后报错
alter table T1 drop column C1;
select * from T1;
其中C1是非关键列,报错如下
Operation not allowed for reason code "7" on table "DB2INST1.AUD_GUIDELINESTORAGE".. SQLCODE=-668, SQLSTATE=57016, DRIVER=3.53.71
按报错提示信息进行
reorg table T1;
新报错,如下:
An unexpected token "table" was found following "reorg ". Expected tokens may include: "JOIN <joined_table>".. SQLCODE=-104, SQLSTATE=42601, DRIVER=3.53.71
若对另一没有主键和约束的临时表进行删除列则没问题,怎么解决?万分感谢
[解决办法]
楼主是在什么环境中执行reorg命令的?可能是你的应用只支持执行SQL语句,不支持执行DB2命令。
用命令行执行reorg吧。