db2 更新表失败,SQLCODE:-668,SQLSTATE:57016,SQLERRMC:7; [英] Failing update table in db2 with SQLCODE: -668, SQLSTATE: 57016, SQLERRMC: 7;
问题描述
我正在使用 db2 9.5 我在表中创建了一个列,该列已成功创建,但我无法更新表列并出现以下错误
I am using db2 9.5 i have created a column in table which is created successfully but i am not able to update table column and getting following error
[错误] 脚本行:1-1 --------------DB2 SQL 错误:SQLCODE:-668,SQLSTATE:57016,SQLERRMC:7;DB2ADMIN.XCATENTRYEXT消息:由于表DB2ADMIN.XCATENTRYEXT"上的原因代码7",不允许操作.
[Error] Script lines: 1-1 -------------------------- DB2 SQL error: SQLCODE: -668, SQLSTATE: 57016, SQLERRMC: 7;DB2ADMIN.XCATENTRYEXT Message: Operation not allowed for reason code "7" on table "DB2ADMIN.XCATENTRYEXT".
按照谷歌上的一些博客/网站,我发现 REORG 命令作为解决方案,如以下链接中所述http://bytes.com/topic/db2/answers/508869-reorg-表空间
Following the some blog/sites on google i found the REORG command as solution as mentioned in following link http://bytes.com/topic/db2/answers/508869-reorg-tablespace
我已尝试在数据库上运行以下查询来解决问题.
i have tried the following queries to run on database to solve the problem.
Database["DB2"].ExecuteNonQuery("call SYSPROC.ADMIN_CMD ('REORG TABLE DB2ADMIN.XCATENTRYEXT index CATENTRY_ID INPLACE')")
REORG TABLE DB2ADMIN.XCATENTRYEXT index CATENTRY_ID INPLACE
REORG TABLE DB2ADMIN.XCATENTRYEXT
REORG INDEXES I0000908 FOR TABLE DB2ADMIN.XCATENTRYEXT
但所有查询在结果中都有相同的错误,例如
but all queries have the same error in result like
DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: Database;BEGIN-OF-STATEMENT;<variable_set>
Message: An unexpected token "Database" was found following "BEGIN-OF-STATEMENT". Expected tokens may include: "<variable_set>".
我被这个错误困住了,我什至无法更新该特定表的任何列.
I am stuck on this error, I am not even able to update any column of that particular table.
推荐答案
从错误消息中可以看出,您以某种方式提交了整个字符串 Database["DB2"].ExecuteNonQuery("call SYSPROC.ADMIN_CMD ('REORG TABLE DB2ADMIN.XCATENTRYEXT index CATENTRY_ID INPLACE')")
作为SQL语句,这显然是不正确的.
It follows from the error message, that you somehow submit the entire string Database["DB2"].ExecuteNonQuery("call SYSPROC.ADMIN_CMD ('REORG TABLE DB2ADMIN.XCATENTRYEXT index CATENTRY_ID INPLACE')")
as a SQL statement, which obviously is incorrect.
只需在 shell 命令行上发出这些:
Simply issue these on the shell command line:
db2 connect to <your database name here>
db2 REORG TABLE DB2ADMIN.XCATENTRYEXT
这篇关于db2 更新表失败,SQLCODE:-668,SQLSTATE:57016,SQLERRMC:7;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!