在SQLite中,执行SQL语句的sqlite3_exec()和sqlite3_prepare()两个核心方法的返回值都是一个整型数据,因此,当程序执行出现错误时,我们可以根据执行返回的整型数据来判断错误发生的原因。以下就是SQLite的错误码:

 #define SQLITE_OK           0   /* 成功 | Successful result */
/* 错误码开始 */
#define SQLITE_ERROR 1 /* SQL错误 或 丢失数据库 | SQL error or missing database */
#define SQLITE_INTERNAL 2 /* SQLite 内部逻辑错误 | Internal logic error in SQLite */
#define SQLITE_PERM 3 /* 拒绝访问 | Access permission denied */
#define SQLITE_ABORT 4 /* 回调函数请求取消操作 | Callback routine requested an abort */
#define SQLITE_BUSY 5 /* 数据库文件被锁定 | The database file is locked */
#define SQLITE_LOCKED 6 /* 数据库中的一个表被锁定 | A table in the database is locked */
#define SQLITE_NOMEM 7 /* 某次 malloc() 函数调用失败 | A malloc() failed */
#define SQLITE_READONLY 8 /* 尝试写入一个只读数据库 | Attempt to write a readonly database */
#define SQLITE_INTERRUPT 9 /* 操作被 sqlite3_interupt() 函数中断 | Operation terminated by sqlite3_interrupt() */
#define SQLITE_IOERR 10 /* 发生某些磁盘 I/O 错误 | Some kind of disk I/O error occurred */
#define SQLITE_CORRUPT 11 /* 数据库磁盘映像不正确 | The database disk image is malformed */
#define SQLITE_NOTFOUND 12 /* sqlite3_file_control() 中出现未知操作数 | Unknown opcode in sqlite3_file_control() */
#define SQLITE_FULL 13 /* 因为数据库满导致插入失败 | Insertion failed because database is full */
#define SQLITE_CANTOPEN 14 /* 无法打开数据库文件 | Unable to open the database file */
#define SQLITE_PROTOCOL 15 /* 数据库锁定协议错误 | Database lock protocol error */
#define SQLITE_EMPTY 16 /* 数据库为空 | Database is empty */
#define SQLITE_SCHEMA 17 /* 数据结构发生改变 | The database schema changed */
#define SQLITE_TOOBIG 18 /* 字符串或二进制数据超过大小限制 | String or BLOB exceeds size limit */
#define SQLITE_CONSTRAINT 19 /* 由于约束违例而取消 | Abort due to constraint violation */
#define SQLITE_MISMATCH 20 /* 数据类型不匹配 | Data type mismatch */
#define SQLITE_MISUSE 21 /* 不正确的库使用 | Library used incorrectly */
#define SQLITE_NOLFS 22 /* 使用了操作系统不支持的功能 | Uses OS features not supported on host */
#define SQLITE_AUTH 23 /* 授权失败 | Authorization denied */
#define SQLITE_FORMAT 24 /* 附加数据库格式错误 | Auxiliary database format error */
#define SQLITE_RANGE 25 /* 传递给sqlite3_bind()的第二个参数超出范围 | 2nd parameter to sqlite3_bind out of range */
#define SQLITE_NOTADB 26 /* 被打开的文件不是一个数据库文件 | File opened that is not a database file */
#define SQLITE_ROW 100 /* sqlite3_step() 已经产生一个行结果 | sqlite3_step() has another row ready */
#define SQLITE_DONE 101 /* sqlite3_step() 完成执行操作 | sqlite3_step() has finished executing */

SQLite错误码的更多相关文章

  1. iOS真机测试友盟碰到错误linker command failed with exit code 1 (use -v to see invocation) 百度地图的检索失败 sqlite 错误码

    因为友盟不支持bitcode 在模拟器上运行正常,但是在模拟器上就会报错,这是因为xocde7之后增加了一个bitcode,bitcode是被编译程序的一种中间形式的代 码.包含bitcode配置的程 ...

  2. UI进阶 SQLite错误码

    #define SQLITE_OK 0 /* 成功 | Successful result */ /* 错误码开始 */ #define SQLITE_ERROR 1 /* SQL错误 或 丢失数据库 ...

  3. Sqlite 错误码

    #define SQLITE_OK 0 /* 成功 | Successful result */ /* 错误码开始 */ #define SQLITE_ERROR 1 /* SQL错误 或 丢失数据库 ...

  4. sqlite3出现SQLITE_BUSY错误码的原因以及解决方法

    转载:https://www.cnblogs.com/lijingcheng/p/4454884.html 转载:https://blog.csdn.net/venchia_lu/article/de ...

  5. sqlite3错误码整理

    #define SQLITE_OK /* 成功 | Successful result */ /* 错误码开始 */ #define SQLITE_ERROR /* SQL错误 或 丢失数据库 | S ...

  6. 腾讯开放平台 手机QQ登录 错误码:110406 解决办法

    作者:Panda Fang 出处:http://www.cnblogs.com/lonkiss/p/4204284.html 原创文章,转载请注明作者和出处,未经允许不可用于商业营利活动 腾讯开发平台 ...

  7. Windows错误码解析

    C或者C++开发肯定经常会遇到各种错误码,由于每个错误码只是一个枚举或者一个整形数值,调试或者输出日志的时候,无法知道这个错误码的具体含义,这时候就需要将此错误码解释出来.对于自己定义的错误码,可以通 ...

  8. win7中 SQL server 2005无法连接到服务器,错误码:18456

    win7中 SQL server 2005无法连接到服务器,错误码:18456.. 数据库刚装完.我用Windows登陆  结果登陆不上去.. 选中SQL Server Management Stud ...

  9. Xcode奔溃错误码

    在这里了解一下XCode用来表示各种崩溃类型的术语,补充一些这方面的各知识.崩溃通常是指操作系统向正在运行的程序发送的信号,所以我们在查看崩溃日志时,常常看到如下错误摘要:Application re ...

随机推荐

  1. Swift - 多行文本输入框(UITextView)

    1,多行文本控件的创建 1 2 3 4 let textview = UITextView(frame:CGRect(x:10, y:100, width:200, height:100)) text ...

  2. velocity思维导图笔记

  3. HTML5+CSS3的响应式网页设计:自动适应屏幕宽度

    这几天都在修改博客上面的样式.本来用的是d83.0的模板.自己又修改了许多地方,其中自己修改的一些地方在手机里面显示的效果不是很理想,于是想改成自适应的效果.对CSS3不是特别的熟练,只能去网上找找案 ...

  4. SQL SERVER 统计信息概述(Statistics)

    前言 查询优化器使用统计信息来创建可提高查询性能的查询计划,对于大多数查询,查询优化器已经为高质量查询计划生成必要的统计信息,但是在少数情况下,您需要创建附加的统计信息或者修改查询设计以得到最佳结果. ...

  5. 杂物 git rebase

  6. zoj 3888 线段树 ***

    卡n^2,用线段树降到nlogn 记录每个点上所覆盖线段的次小值,保证能有两条路径能走 #include<cstdio> #include<iostream> #include ...

  7. Ubuntu下安装Nginx

    转载自:http://www.cnblogs.com/skynet/p/4146083.html 1.Nginx安装 我使用的环境是64位 Ubuntu 14.04, Nginx是Nginx 1.10 ...

  8. mysql的启动

    1.直接用mysqld手工启动 [root@ora11g bin]# ./mysqld --defaults-file=../my.cnf :: [ERROR] Fatal error: Please ...

  9. Accelerating Matlab

    Matlab is a very useful programming environment, but it also has many inefficiencies. You might thin ...

  10. [unity3d插件]2dtoolkit系列一 创建精灵

    从今天开始要做一个2d游戏,由于之前都是做cocos2dx的,然后接触了一段时间的unity3d,都是做3D方面的东西,得知要做2d游戏还是有点开心的,或许因为不想丢失之前的2d游戏的一些思想,然后接 ...