sth88 发表于 2007-07-23 09:35

drop table 出错

一个sql在程序中偶尔会报错出来。
drop table jour; sqlcode=214 sqlerrd=106
程序的大概流程是先
lock table jour in exclusive mode;
然后进行大量的其他表的删除和插入操作;
最后在drop table jour报错。
请问会不会和某个数据的参数设置有关,主要是它不是每次都出错,过一段时间才出一次,没有规律。

liaosnet 发表于 2007-07-23 15:48

-214    Cannot remove file for table table-name.

The database server cannot completely remove the table. Check the
accompanying ISAM error code for more information. Problems with
operating-system file permissions, read-only files, or hardware might
cause this error.

可能是有另一個用戶在訪問這個表~~~~

-106    ISAM error: non-exclusive access.

The ISAM processor has been asked to add or drop an index but it does
not have exclusive access. For C-ISAM programs, the file must be opened
with exclusive access before you perform this operation. Review the
program logic, and make sure that it opens this file by passing the
ISEXCLLOCK flag to isopen. For SQL products, the database server
returns this error when an exclusive lock is required on a table. For
example, this error appears when a second user tries to alter a table
that the first user has locked.

cwj79410 发表于 2007-07-24 22:28

106非互斥访问
214不能删除系统目录

sth88 发表于 2007-07-30 08:47

但是开始我lock表时并没有报错,说明开始lock表是成功了,既然成功,就不应该报106的错啊。
哪位高手能不能说详细点

ivhb 发表于 2007-07-30 09:36

1,可能是lock成功后,你进行了很多操作,操作完成后commit,导致锁释放。如果是这样的情况,应该把drop语句也放入同一个更大范围的事务。
2,drop table时候,会导致对systables表的独占。如果另外其他的任务在执行create table/drop table 等,会导致你失败。这种情况,你只能
exec sql set lock mode to wait;//设定无限等待模式

onlymissyou 发表于 2007-08-10 18:08

-106        ISAM错误: 非排它存取。

ISAM处理器被要求增加或取消一个索引,但它并没有排它存取权。对C-ISAM程序,在
做这个操作之前文件必须以排它存取方式打开。检查程序逻辑,确保在打开文件时把
ISEXCLLOCK标志传递给了isopen。对SQL产品,在要求对表的排它锁定时,
INFORMIX-OnLine 动态服务器和INFORMIX-SE数据库服务器中可能会返回这个错误。
例如,当第一个用户锁定了表后,第二个用户又试图变更表时,就会出现这个错误。

214        不能给表<表名>删除文件。

数据库服务器不能完全地删除表。检查伴随的ISAM错误代码以获得更多的信息。
操作系统的文件访问权限问题,只读文件和硬件错误可能引发这个错误。
页: [1]
查看完整版本: drop table 出错