此表提供了SQLSTATE上下文变量的错误代码和消息文本。
一个SQLSTATE错误代码的结构是五个字符,包括SQL错误类(2个字符),SQL子类(3个字符)。
表 B.1. SQLSTATE 代码和消息文本
SQLSTATE | 消息文本(英文) | 消息文本(中文) |
SQLCLASS 00 (Success) | ||
0 | Success |
成功
|
SQLCLASS 01 (Warning) | ||
1000 | General warning |
一般警告
|
1001 | Cursor operation conflict |
游标操作冲突
|
1002 | Disconnect error |
断开连接错误
|
1003 | NULL value eliminated in set function |
在设置功能消除了空值
|
1004 | String data right-truncated |
字符串数据右截断
|
1005 | Insufficient item descriptor areas |
不足的项目描述符区
|
1006 | Privilege not revoked |
未撤消特权
|
1007 | Privilege not granted |
未授予特权
|
1008 | Implicit zero-bit padding |
隐式零位填充
|
1100 | Statement reset to unprepared |
将重置为没有准备好的语句
|
1101 | Ongoing transaction has been committed |
正在进行的事务一直致力
|
1102 | Ongoing transaction has been rolled back |
正在进行的事务已回退
|
SQLCLASS 02 (No Data) | ||
2000 | No data found or no rows affected |
未找到数据或没有行受影响
|
SQLCLASS 07 (Dynamic SQL error) | ||
7000 | Dynamic SQL error |
动态 SQL 错误
|
7001 | Wrong number of input parameters |
输入参数的数目不正确
|
7002 | Wrong number of output parameters |
输出参数数目不对
|
7003 | Cursor specification cannot be executed |
不能执行游标规范
|
7004 | USING clause required for dynamic parameters |
使用子句所需的动态参数
|
7005 | Prepared statement not a cursor-specification |
预准备的语句不是指定的游标
|
7006 | Restricted data type attribute violation |
受限制的数据类型属性冲突
|
7007 | USING clause required for result fields |
USING子句需要结果字段
|
7008 | Invalid descriptor count |
无效的描述符计数
|
7009 | Invalid descriptor index |
无效的描述符索引
|
SQLCLASS 08 (Connection Exception) | ||
8001 | Client unable to establish connection |
客户端无法建立连接
|
8002 | Connection name in use |
连接名称已在使用
|
8003 | Connection does not exist |
连接不存在
|
8004 | Server rejected the connection |
服务器拒绝连接
|
8006 | Connection failure |
连接失败
|
8007 | Transaction resolution unknown |
未知的事务的解析
|
SQLCLASS 0A (Feature Not Supported) | ||
0A000 | Feature Not Supported |
不支持的功能
|
SQLCLASS 0B (Invalid Transaction Initiation) | ||
0B000 | Invalid transaction initiation |
无效的事务启动
|
SQLCLASS 0L (Invalid Grantor) | ||
0L000 | Invalid grantor |
无效的授予者
|
SQLCLASS 0P (Invalid Role Specification) | ||
0P000 | Invalid role specification |
无效的角色规范
|
SQLCLASS 0U (Attempt to Assign to Non-Updatable Column) | ||
0U000 | Attempt to assign to non-updatable column |
试图将分配给非可更新的列
|
SQLCLASS 0V (Attempt to Assign to Ordering Column) | ||
0V000 | Attempt to assign to Ordering column |
试图将分配给排序列
|
SQLCLASS 20 (Case Not Found For Case Statement) | ||
20000 | Case not found for case statement |
找不到 case 语句的情况下
|
SQLCLASS 21 (Cardinality Violation) | ||
21000 | Cardinality violation |
基数违反
|
21S01 | Insert value list does not match column list |
插入值列表与列列表不匹配
|
21S02 | Degree of derived table does not match column list |
派生表的程度与列列表不匹配
|
SQLCLASS 22 (Data Exception) | ||
22000 | Data exception |
数据异常
|
22001 | String data, right truncation |
字符串数据右截断
|
22002 | Null value, no indicator parameter |
空的价值,没有指标参数
|
22003 | Numeric value out of range |
数字值超出范围
|
22004 | Null value not allowed |
不允许空值
|
22005 | Error in assignment |
分配时出错
|
22006 | Null value in field reference |
字段引用NULL值
|
22007 | Invalid datetime format |
无效的日期时间格式
|
22008 | Datetime field overflow |
日期时间字段溢出
|
22009 | Invalid time zone displacement value |
无效的时区取代值
|
2200A | Null value in reference target |
引用目标中的空值
|
2200B | Escape character conflict |
转义字符冲突
|
2200C | Invalid use of escape character |
使用无效的转义字符
|
2200D | Invalid escape octet |
无效的转义八进制数
|
2200E | Null value in array target |
目标数组中的空值
|
2200F | Zero-length character string |
长度为零的字符串
|
2200G | Most specific type mismatch |
最具体的类型不匹配
|
22010 | Invalid indicator parameter value |
无效的指标参数值
|
22011 | Substring error |
子字符串错误
|
22012 | Division by zero |
被零除
|
22014 | Invalid update value |
无效的更新值
|
22015 | Interval field overflow |
间隔字段溢出
|
22018 | Invalid character value for cast |
无效的字符值强制转换为
|
22019 | Invalid escape character |
无效的转义字符
|
2201B | Invalid regular expression |
无效的正则表达式
|
2201C | Null row not permitted in table |
不允许在表中的空行
|
22012 | Division by zero |
被零除
|
22020 | Invalid limit value |
无效的限定值
|
22021 | Character not in repertoire |
字符不在指令表
|
22022 | Indicator overflow |
指示符溢出
|
22023 | Invalid parameter value |
参数值无效
|
22024 | Character string not properly terminated |
字符串不正确地被终止
|
22025 | Invalid escape sequence |
无效的转义序列
|
22026 | String data, length mismatch |
字符串数据,长度不匹配
|
22027 | Trim error |
修剪的错误
|
22028 | Row already exists |
行已存在
|
2202D | Null instance used in mutator function |
mutator函数中使用了 null 实例
|
2202E | Array element error |
数组元素错误
|
2202F | Array data, right truncation |
数级数据右截断
|
SQLCLASS 23 (Integrity Constraint Violation) | ||
23000 | Integrity constraint violation |
违反完整性约束
|
SQLCLASS 24 (Invalid Cursor State) | ||
24000 | Invalid cursor state |
无效的游标状态
|
24504 | The cursor identified in the UPDATE, DELETE, SET, or GET statement is not positioned on a row |
在"UPDATE、DELETE、SET"或"GET"语句中标识的游标未被放置在一行上
|
SQLCLASS 25 (Invalid Transaction State) | ||
25000 | Invalid transaction state |
无效的事务状态
|
25S01 | Transaction state |
事务状态
|
25S02 | Transaction is still active |
交易是仍处于活动状态
|
25S03 | Transaction is rolled back |
回滚事务
|
SQLCLASS 26 (Invalid SQL Statement Name) | ||
26000 | Invalid SQL statement name |
无效的 SQL 语句名称
|
SQLCLASS 27 (Triggered Data Change Violation) | ||
27000 | Triggered data change violation |
触发的数据改变违规
|
SQLCLASS 28 (Invalid Authorization Specification) | ||
28000 | Invalid authorization specification |
无效的授权说明
|
SQLCLASS 2B (Dependent Privilege Descriptors Still Exist) | ||
2B000 | Dependent privilege descriptors still exist |
依赖特权描述符仍然存在
|
SQLCLASS 2C (Invalid Character Set Name) | ||
2C000 | Invalid character set name |
无效的字符集的名称
|
SQLCLASS 2D (Invalid Transaction Termination) | ||
2D000 | Invalid transaction termination |
无效的事务终止
|
SQLCLASS 2E (Invalid Connection Name) | ||
2.00E+00 | Invalid connection name |
无效的连接名称
|
SQLCLASS 2F (SQL Routine Exception) | ||
2F000 | SQL routine exception |
SQL 常规异常
|
2F002 | Modifying SQL-data not permitted |
修改 SQL 数据不允许
|
2F003 | Prohibited SQL-statement attempted |
禁止的 SQL 语句尝试
|
2F004 | Reading SQL-data not permitted |
阅读 SQL 数据不允许
|
2F005 | Function executed no return statement |
执行函数没有返回语句
|
SQLCLASS 33 (Invalid SQL Descriptor Name) | ||
33000 | Invalid SQL descriptor name |
无效的 SQL 描述符名称
|
SQLCLASS 34 (Invalid Cursor Name) | ||
34000 | Invalid cursor name |
无效的游标名称
|
SQLCLASS 35 (Invalid Condition Number) | ||
35000 | Invalid condition number |
无效的条件数
|
SQLCLASS 36 (Cursor Sensitivity Exception) | ||
36001 | Request rejected |
请求被拒绝
|
36002 | Request failed |
请求失败
|
SQLCLASS 37 (Invalid Identifier) | ||
37000 | Invalid identifier |
无效的标识符
|
37001 | Identifier too long |
标识符太长
|
SQLCLASS 38 (External Routine Exception) | ||
38000 | External routine exception |
外部的常规异常
|
SQLCLASS 39 (External Routine Invocation Exception) | ||
39000 | External routine invocation exception |
调用外部例程时异常
|
SQLCLASS 3B (Invalid Save Point) | ||
3B000 | Invalid save point |
无效的保存点
|
SQLCLASS 3C (Ambiguous Cursor Name) | ||
3C000 | Ambiguous cursor name |
含糊不清的游标名称
|
SQLCLASS 3D (Invalid Catalog Name) | ||
3D000 | Invalid catalog name |
目录名称无效
|
3D001 | Catalog name not found |
找不到的目录名称
|
SQLCLASS 3F (Invalid Schema Name) | ||
3F000 | Invalid schema name |
模式名称无效
|
SQLCLASS 40 (Transaction Rollback) | ||
40000 | Ongoing transaction has been rolled back |
正在进行的事务已回滚
|
40001 | Serialization failure |
序列化失败
|
40002 | Transaction integrity constraint violation |
事务完整性约束违规
|
40003 | Statement completion unknown |
语句完成未知
|
SQLCLASS 42 (Syntax Error or Access Violation) | ||
42000 | Syntax error or access violation |
语法错误或访问冲突
|
42702 | Ambiguous column reference |
含糊不清的列引用
|
42725 | Ambiguous function reference |
含糊不清的函数参考
|
42818 | The operands of an operator or function are not compatible |
操作数的运算符或函数是不兼容
|
42S01 | Base table or view already exists |
基表或视图已存在
|
42S02 | Base table or view not found |
基表或视图未找到
|
42S11 | Index already exists |
索引已经存在
|
42S12 | Index not found |
找不到索引
|
42S21 | Column already exists |
已存在的列
|
42S22 | Column not found |
找不到列
|
SQLCLASS 44 (With Check Option Violation) | ||
44000 | WITH CHECK OPTION Violation |
与复选选项冲突
|
SQLCLASS 45 (Unhandled User-defined Exception) | ||
45000 | Unhandled user-defined exception |
用户定义的异常
|
SQLCLASS 54 (Program Limit Exceeded) | ||
54000 | Program limit exceeded |
超出了程序限制
|
54001 | Statement too complex |
语句太复杂
|
54011 | Too many columns |
太多的列
|
54023 | Too many arguments |
参数太多
|
SQLCLASS HY (CLI-specific Condition) | ||
HY000 | CLI-specific condition |
CLI 特定条件
|
HY001 | Memory allocation error |
内存分配错误
|
HY003 | Invalid data type in application descriptor |
应用程序描述符中的无效数据类型
|
HY004 | Invalid data type |
无效的数据类型
|
HY007 | Associated statement is not prepared |
关联的语句没有准备
|
HY008 | Operation canceled |
取消操作
|
HY009 | Invalid use of null pointer |
使用无效的空指针
|
HY010 | Function sequence error |
函数序列错误
|
HY011 | Attribute cannot be set now |
现在无法设置属性
|
HY012 | Invalid transaction operation code |
无效的事务操作代码
|
HY013 | Memory management error |
内存管理错误
|
HY014 | Limit on the number of handles exceeded |
超出了句柄数限制
|
HY015 | No cursor name available |
没有可用的游标名称
|
HY016 | Cannot modify an implementation row descriptor |
不能修改行描述符实现
|
HY017 | Invalid use of an automatically allocated descriptor handle |
使用的自动分配的描述符句柄无效
|
HY018 | Server declined the cancellation request |
服务器拒绝取消请求
|
HY019 | Non-string data cannot be sent in pieces |
不在块中发送非字符串数据
|
HY020 | Attempt to concatenate a null value |
尝试连接空值
|
HY021 | Inconsistent descriptor information |
描述符信息不一致
|
HY024 | Invalid attribute value |
无效的属性值
|
HY055 | Non-string data cannot be used with string routine |
非字符串数据不能用于字符串例程
|
HY090 | Invalid string length or buffer length |
无效的字符串长度或缓冲区长度
|
HY091 | Invalid descriptor field identifier |
无效的描述符字段标识符
|
HY092 | Invalid attribute identifier |
无效的属性标识符
|
HY095 | Invalid Function ID specified |
指定了无效函数 ID
|
HY096 | Invalid information type |
信息类型无效
|
HY097 | Column type out of range |
列类型超出范围
|
HY098 | Scope out of range |
超出范围的范围
|
HY099 | Nullable type out of range |
可以为 null 的类型超出范围
|
HY100 | Uniqueness option type out of range |
唯一性选项类型超出范围
|
HY101 | Accuracy option type out of range |
准确性选项类型超出范围
|
HY103 | Invalid retrieval code |
检索代码无效
|
HY104 | Invalid Length/Precision value |
无效的长度/精度值
|
HY105 | Invalid parameter type |
无效的参数类型
|
HY106 | Invalid fetch orientation |
无效的获取方向
|
HY107 | Row value out of range |
行值超出范围
|
HY109 | Invalid cursor position |
无效的游标位置
|
HY110 | Invalid driver completion |
无效的驱动程序完成
|
HY111 | Invalid bookmark value |
无效的书签值
|
HYC00 | Optional feature not implemented |
可选功能未实现
|
HYT00 | Timeout expired | 连接超时 |
HYT01 | Connection timeout expired |
连接超时已过期
|
SQLCLASS XX (Internal Error) | ||
XX000 | Internal error |
内部错误
|
XX001 | Data corrupted |
数据已损坏
|
XX002 | Index corrupted |
索引损坏
|