SQLite错误码
2016-05-11 16:44
447 查看
在SQLite中,执行SQL语句的sqlite3_exec()和sqlite3_prepare()两个核心方法的返回值都是一个整型数据,因此,当程序执行出现错误时,我们可以根据执行返回的整型数据来判断错误发生的原因。以下就是SQLite的错误码:
1 #define SQLITE_OK 0 /* 成功 | Successful result */ 2 /* 错误码开始 */ 3 #define SQLITE_ERROR 1 /* SQL错误 或 丢失数据库 | SQL error or missing database */ 4 #define SQLITE_INTERNAL 2 /* SQLite 内部逻辑错误 | Internal logic error in SQLite */ 5 #define SQLITE_PERM 3 /* 拒绝访问 | Access permission denied */ 6 #define SQLITE_ABORT 4 /* 回调函数请求取消操作 | Callback routine requested an abort */ 7 #define SQLITE_BUSY 5 /* 数据库文件被锁定 | The database file is locked */ 8 #define SQLITE_LOCKED 6 /* 数据库中的一个表被锁定 | A table in the database is locked */ 9 #define SQLITE_NOMEM 7 /* 某次 malloc() 函数调用失败 | A malloc() failed */ 10 #define SQLITE_READONLY 8 /* 尝试写入一个只读数据库 | Attempt to write a readonly database */ 11 #define SQLITE_INTERRUPT 9 /* 操作被 sqlite3_interupt() 函数中断 | Operation terminated by sqlite3_interrupt() */ 12 #define SQLITE_IOERR 10 /* 发生某些磁盘 I/O 错误 | Some kind of disk I/O error occurred */ 13 #define SQLITE_CORRUPT 11 /* 数据库磁盘映像不正确 | The database disk image is malformed */ 14 #define SQLITE_NOTFOUND 12 /* sqlite3_file_control() 中出现未知操作数 | Unknown opcode in sqlite3_file_control() */ 15 #define SQLITE_FULL 13 /* 因为数据库满导致插入失败 | Insertion failed because database is full */ 16 #define SQLITE_CANTOPEN 14 /* 无法打开数据库文件 | Unable to open the database file */ 17 #define SQLITE_PROTOCOL 15 /* 数据库锁定协议错误 | Database lock protocol error */ 18 #define SQLITE_EMPTY 16 /* 数据库为空 | Database is empty */ 19 #define SQLITE_SCHEMA 17 /* 数据结构发生改变 | The database schema changed */ 20 #define SQLITE_TOOBIG 18 /* 字符串或二进制数据超过大小限制 | String or BLOB exceeds size limit */ 21 #define SQLITE_CONSTRAINT 19 /* 由于约束违例而取消 | Abort due to constraint violation */ 22 #define SQLITE_MISMATCH 20 /* 数据类型不匹配 | Data type mismatch */ 23 #define SQLITE_MISUSE 21 /* 不正确的库使用 | Library used incorrectly */ 24 #define SQLITE_NOLFS 22 /* 使用了操作系统不支持的功能 | Uses OS features not supported on host */ 25 #define SQLITE_AUTH 23 /* 授权失败 | Authorization denied */ 26 #define SQLITE_FORMAT 24 /* 附加数据库格式错误 | Auxiliary database format error */ 27 #define SQLITE_RANGE 25 /* 传递给sqlite3_bind()的第二个参数超出范围 | 2nd parameter to sqlite3_bind out of range */ 28 #define SQLITE_NOTADB 26 /* 被打开的文件不是一个数据库文件 | File opened that is not a database file */ 29 #define SQLITE_ROW 100 /* sqlite3_step() 已经产生一个行结果 | sqlite3_step() has another row ready */ 30 #define SQLITE_DONE 101 /* sqlite3_step() 完成执行操作 | sqlite3_step() has finished executing */
相关文章推荐
- mysql锁定机制
- Oracle AWR报告的生成
- Ubuntu mongodb 安装和配置
- Redis数据类型操作(四) —— Set
- MySQL MHA
- MYSQL必知必会读书笔记 第十九至二十一章 数据的插入、更新、删除
- Oracle 11g笔记——RAC简介、意义
- 转:SQL中 patindex函数的用法
- Redis数据类型操作(三) —— List
- Oracle 11g笔记——存储过程
- oracle统计一年中每个月的数据
- 浅谈SQL语句执行顺序分析
- oracle环境安装一些我的bugs
- *MyBatis框架 在控制台打印sql语句
- 如何在Win8系统上安装MySQL 5.6
- Oracle服务器上Swap的配置
- sql 语句大全
- ORMLite数据库框架的简单使用
- redis概览
- [待完善]MySQL SQL线程hang住问题分析