DB2 SQL Error: SQLCODE=-668, SQLSTATE=57016, SQLERRMC=7

2021/8/6 19:09:20

本文主要是介绍DB2 SQL Error: SQLCODE=-668, SQLSTATE=57016, SQLERRMC=7,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

DB2 SQL Error: SQLCODE=-668, SQLSTATE=57016, SQLERRMC=7

在执行SQL语句时,遇到这个错误,百度了一番,出现这个错误的原因是我们之前对修改过这个表,我的具体操作是使用alter table语句删除了表中的某一个列,导致这个表处于重组挂起状态,需要使用REORG TABLE语句重构表,但是在SQL命令端是无法直接执行REORG TABLE XXX语句的,需要通过调用数据库自带的存储过程来执行这一命令,语句如下:

call Sysproc.admin_cmd('REORG TABLE 表名');

参考原文:

Operation not allowed for reason code reason-code on table table-name.
Explanation: Access to table table-name is restricted. The cause is based on the following reason codes reason-code: 7
The table is in the reorg pending state. This can occur after an ALTER TABLE statement containing a REORG-recommended operation.7
Reorganize the table using the REORG TABLE command (note that INPLACE REORG TABLE is not allowed for a table that is in the reorg pending state).



这篇关于DB2 SQL Error: SQLCODE=-668, SQLSTATE=57016, SQLERRMC=7的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程