SQL-92定义的errorcode 通过PDO什么的返回的值~
来源:互联网 发布:python中的注释 编辑:程序博客网 时间:2024/04/29 20:09
from: http://docstore.mik.ua/orelly/java-ent/jenut/ch08_06.htm
就平常我们经常遇到的返回码比如42000
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
可以看到是大分类42 Syntax error or access rule violation 子分类无
如果需要根据errorcode进行捕获,那么。。。就参考下面这张表就ok了
The SQL-92 standard defines a set of SQLSTATE return codes.SQLSTATE is defined as a five-character string, where the leftmost two characters define the error class, and the remaining three characters define the error subclass. Some database vendors may extend these return codes; classes beginning with the numbers 5 through 9 and letters I through Z are reserved for such implementation-specific extensions. TheSQLSTATE code for a particular JDBC action can be retrieved via thegetSQLState() method of SQLException.Table 8-3 lists the SQLSTATE return codes defined in SQL-92.
Table 8-3. SQL-92 SQLSTATE Return Codes
Class
Class Definition
Subclass
Subclass Definition
00
Successful completion
000
None
01
Warning
000
None
001
Cursor operation conflict
002
Disconnect error
003
Null value eliminated in set function
004
String data, right truncation
005
Insufficient item descriptor areas
006
Privilege not revoked
007
Privilege not granted
008
Implicit zero-bit padding
009
Search expression too long for information schema
00A
Query expression too long for information schema
02
No data
000
None
07
Dynamic SQL error
000
None
001
Using clause doesn't match dynamic parameters
002
Using clause doesn't match target specifications
003
Cursor specification can't be executed
004
Using clause required for dynamic parameters
005
Prepared statement not a cursor specification
006
Restricted data type attribute violation
007
Using clause required for result fields
008
Invalid descriptor count
009
Invalid descriptor index
08
Connection Exception
000
None
001
SQL-client unable to establish SQL-connection
002
Connection name in use
003
Connection doesn't exist
004
SQL-server rejected establishment of SQL-connection
006
Connection failure
007
Transaction resolution unknown
0A
Feature not supported
000
None
001
Multiple server transactions
21
Cardinality violation
000
None
22
Data exception
000
None
001
String data, right truncation
002
Null value, no indicator
003
Numeric value out of range
005
Error in assignment
007
Invalid date-time format
008
Date-time field overflow
009
Invalid time zone displacement value
011
Substring error
012
Division by zero
015
Internal field overflow
018
Invalid character value for cast
019
Invalid escape character
021
Character not in repertoire
022
Indicator overflow
023
Invalid parameter value
024
Unterminated C string
025
Invalid escape sequence
026
String data, length mismatch
027
Trim error
23
Integrity constraint violation
000
None
24
Invalid cursor state
000
None
25
Invalid transaction state
000
None
26
Invalid SQL statement name
000
None
27
Triggered data change violation
000
None
28
Invalid authorization specification
000
None
2A
Syntax error or access rule violation in direct SQL statement
000
None
2B
Dependent privilege descriptors still exist
000
None
2C
Invalid character set name
000
None
2D
Invalid transaction termination
000
None
2E
Invalid connection name
000
None
33
Invalid SQL descriptor name
000
None
34
Invalid cursor name
000
None
35
Invalid condition number
000
None
37
Syntax error or access rule violation in dynamic SQL statement
000
None
3C
Ambiguous cursor name
000
None
3F
Invalid schema name
000
None
40
Transaction rollback
000
None
001
Serialization failure
002
Integrity constraint violation
003
Statement completion unknown
42
Syntax error or access rule violation
000
None
44
With check option violation
000
None
- SQL-92定义的errorcode 通过PDO什么的返回的值~
- php pdo 返回sql 后的东西
- 要求通过定义无参带返回值的方法来实现,返回值为最大年龄 2
- SQLiteException 的 ErrorCode!
- PDO::lastInsertId函数返回0的原因
- Socket的ErrorCode的说明
- Socket的ErrorCode的说明
- php pdo sqlserver分页sql的处理
- PDO防止sql注入的机制
- PDO处理SQL注入的简单方法
- pdo是如何防止 sql注入的
- 豌豆荚的做什么的
- php-pdo的lastInsertId返回0的问题
- 定义带带返回值的方法
- 带返回值的宏定义
- [php] pdo 查询 mysql 返回值 int 转 string 类型的问题
- 【PDO扩展】lastInsertId函数返回0的原因
- 如何通过动态sql远程调用包里面的函数,并返回值。
- left join 后,去掉重复记录
- 一个轻量级的开源TCP/IP协议栈
- UNIX上的C++程序设计守则( 信号和线程 下)
- 奇特的javascript特性
- 初始化vs环境 命令
- SQL-92定义的errorcode 通过PDO什么的返回的值~
- 个人常用的VIM命令列表
- Android中的XML解析与生成
- 在VIM中设置 显示行号,语法高亮,自动缩进
- svn常用命令
- Android之SharedPreferences
- Android之短信窃听器
- ORACLE EBS FORM开发步骤
- 云计算、SaaS和PaaS的含义及特点