附录A. 错误信息

主要的错误信息如下:

sqlcode sqlstate 错误信息 错误解释
00001 01000 General warning 一般警告信息
00002 01001 Cursor operation conflict 游标操作冲突
00003 01002 Disconnect error 断开连接错误
00004 01003 NULL value eliminated in set function 集合函数中消除的空值
00005 01004 String data, right truncated 字符串数据,右截断。一般是数据长度大于绑定变量长度导致
00006 01006 Privilege not revoked 权限未被撤销
00007 01007 Privilege not granted 未授予权限
00008 01S00 Invalid connection string attribute 无效的连接字符串属性
00009 01S01 Error in row 行中出错
00010 01S02 Option Value changed 选项值已更改
00011 01S06 Attempt to fetch before the result set returned the first rowset 在结果集返回第一行集之前尝试获取
00012 01S07 Fractional truncation 分数截断
00013 01S08 Error saving file DSN 保存文件DSN时出错
00014 01S09 Invalid keyword 无效关键字
00015 07001 Wrong number of parameters 参数数量错误
00016 07002 COUNT field incorrect 计数字段不正确
00017 07005 Prepared statement not a cursor-specification 准备好的语句不符合游标规范
00018 07006 Restricted data type attribute violation 受限数据类型属性冲突
00019 07009 Invalid descriptor index 描述符索引无效
00020 07S01 Invalid use of default parameter 默认参数的使用无效
00021 08001 Client unable to establish connection 客户端无法建立连接
00022 08002 Connection name in use 正在使用的连接名称
00023 08003 Connection does not exist 连接不存在
00024 08004 Server rejected the connection 服务器拒绝了连接
00025 08007 Connection failure during transaction 事务处理期间的连接失败
00026 08S01 Communication link failure 通信链路故障,此时ODBC与数据库直接的网络已经断开
00027 21S01 Insert value list does not match column list 插入值列表与列列表不匹配
00028 21S02 Degree of derived table does not match column list 派生表的度数与列列表不匹配
00029 22001 String data, right truncation 字符串数据,右截断
00030 22002 Indicator variable required but not supplied 需要指示器变量,但未提供,一般是如果查询列数据有NULL时报此错
00031 22003 Numeric value out of range 数值超出范围
00032 22007 Invalid datetime format 无效的日期格式
00033 22008 Date/time field overflow 日期/时间字段溢出
00034 22012 Division by zero 除零错误
00035 22015 Interval field overflow 间隔字段溢出
00036 22018 Invalid character value for cast specification 强制转换规范的字符值无效
00037 22019 Invalid escape character 无效转义字符
00038 22025 Invalid escape sequence 无效的转义序列
00039 22026 String data, length mismatch 字符串数据,长度不匹配
00040 23000 Integrity constraint violation 完整性约束冲突
00041 24000 Invalid cursor state 无效的游标状态
00042 25000 Invalid transaction state 无效的事务状态
00043 25S01 Transaction state unknown 事务状态未知
00044 25S02 Transaction is still active 事务仍在进行中
00045 25S03 Transaction is rolled back 事务被回滚
00046 28000 Invalid authorization specification 无效的授权规范
00047 34000 Invalid cursor name 无效的游标名称
00048 3C000 Duplicate cursor name 重复的游标名称
00049 3D000 Invalid catalog name 无效的目录名,目录一般指的数据库实例名称
00050 3F000 Invalid schema name 无效的模式名
00051 40001 Serialization failure 序列化失败
00052 40002 Integrity constraint violation 完整性约束冲突
00053 40003 Statement completion unknown 语句完成未知
00054 42000 Syntax error or access violation 语法错误或访问冲突
00055 42S01 Base table or view already exists 基表或视图已存在
00056 42S02 Base table or view already exists 找不到基表或视图
00057 42S11 Index already exists 索引已经存在
00058 42S12 Index not found 找不到索引
00059 42S21 Column already exists 列已存在
00060 42S22 Column not found 找不到列
00061 44000 WITH CHECK OPTION violation 与检查选项冲突
00062 HY000 General error 一般错误
00063 HY001 Memory allocation error 内存分配错误,这个错误出现后,请检查当前客户端的内存使用情况
00064 HY003 Invalid application buffer type 无效的应用程序缓冲区类型
00065 HY004 Invalid backend data type 无效的后端数据类型
00066 HY007 Associated statement is not prepared 未准备相关声明
00067 HY008 Operation canceled 操作取消了
00068 HY009 Invalid use of null pointer 无效使用空指针
00069 HY010 Function sequence error 函数序列错误
00070 HY011 Attribute cannot be set now 现在无法设置属性
00071 HY012 Invalid transaction operation code 无效的事务操作代码
00072 HY013 Memory management error 内存管理错误
00073 HY014 Limit on the number of handles exceeded 超出句柄数的限制
00074 HY015 No cursor name available 没有可用的游标名称
00075 HY016 Cannot modify an implementation row descriptor 无法修改实现行描述符
00076 HY017 Invalid use of an automatically allocated descriptor handle 自动分配的描述符句柄的使用无效
00077 HY018 Server declined cancel request 服务器拒绝了取消请求
00078 HY019 Non-character and non-binary data sent in pieces 以片段形式发送的非字符和非二进制数据
00079 HY020 Attempt to concatenate a null value 尝试连接空值
00080 HY021 Inconsistent descriptor information 描述符信息不一致
00081 HY024 Invalid attribute value 属性值无效
00082 HY090 Invalid string or buffer length 无效的字符串或缓冲区长度
00083 HY091 Invalid descriptor field identifier 描述符字段标识符无效
00084 HY092 Invalid attribute/option identifier 属性/选项标识符无效
00085 HY095 Function type out of range 函数类型超出范围
00086 HY096 Information type out of range 信息类型超出范围
00087 HY097 Column type out of range 列类型超出范围
00088 HY098 Scope type out of range 范围类型超出范围
00089 HY099 Nullable type out of range 可空类型超出范围
00090 HY100 Uniqueness option type out of range 唯一性选项类型超出范围
00091 HY101 Accuracy option type out of range 精度选项类型超出范围
00092 HY103 Invalid retrieval code 无效的检索代码
00093 HY104 Invalid precision or scale value 精度或刻度值无效
00094 HY105 Invalid parameter type 无效的参数类型
00095 HY106 Fetch type out of range 获取类型超出范围
00096 HY107 Row value out of range 行值超出范围
00097 HY109 Invalid cursor position 无效的光标位置
00098 HY110 Invalid driver completion 驱动程序完成无效
00099 HY111 Invalid bookmark value 无效的书签值
00100 HYC00 Optional feature not implemented 未实现可选功能
00101 HYT00 Timeout expired 超时已过期
00102 HYT01 Connection timeout expired 连接超时已过期
00103 IM001 Driver does not support this function 驱动程序不支持此功能
00104 IM002 Data source not found and no default driver specified 找不到数据源,未指定默认驱动程序
00105 IM003 Specified driver could not be loaded 无法加载指定的驱动程序
00106 IM004 Driver's SQLAllocHandle on SQL_HANDLE_ENV failed 驱动程序调用SQLAllocHandle分配SQL_HANDLE_ENV失败
00107 IM005 Driver's SQLAllocHandle on SQL_HANDLE_DBC failed 驱动程序调用SQLAllocHandle分配SQL_HANDLE_DBC失败
00108 IM006 Driver's SQLSetConnectAttr failed 驱动程序调用SQLSetConnectAttr失败
00109 IM007 No data source or driver specified; dialog prohibited 没有指定数据源或驱动程序;禁止对话
00110 IM008 Dialog failed 对话失败
00111 IM009 Unable to load translation DLL 无法加载翻译DLL
00112 IM010 Data source name too long 数据源名称太长
00113 IM011 Driver name too long 驱动程序名称太长
00114 IM012 DRIVER keyword syntax error 驱动程序关键字语法错误
00115 IM013 Trace file error 跟踪文件错误
00116 IM014 Invalid name of file DSN 文件DSN的名称无效
00117 IM015 Corrupt file data source 损坏的文件数据源
00118 S1107 Row value out of range 行值超出范围
00119 S1108 Concurrency option out of range 并发选项超出范围
00120 IP001 Invlid direct 无效的加载方向