db2中更新表失败,其SQLCODE:-668,SQLSTATE:57016,SQLERRMC:7; [英] Failing update table in db2 with SQLCODE: -668, SQLSTATE: 57016, SQLERRMC: 7;

查看:332
本文介绍了db2中更新表失败,其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".

在Google上的一些博客/网站之后,我发现REORG命令作为解决方案,如以下链接
http://bytes.com/topic/db2/answers/508869-reorg-tablespace

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(调用SYSPROC.ADMIN_CMD( REORG表DB2ADMIN.XCATENTRYEXT索引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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆