sqlite3.h的常用宏定义,错误代码

原文链接:sqlite3.h的常用宏定义,错误代码(SQLITE_OK、SQLITE_BUSY等)-CSDN博客

许多SQLite函数从这里显示的集合中返回一个整数结果代码,以指示成功或失败。
如 sqlite3_open 、sqlite3_get_table、 sqlite3_exec函数的返回值

/*
** CAPI3REF: Result Codes
** KEYWORDS: SQLITE_OK {error code} {error codes}
** KEYWORDS: {result code} {result codes}
**
** Many SQLite functions return an integer result code from the set shown
** here in order to indicate success or failure.
**
** New error codes may be added in future versions of SQLite.
**
** See also: [SQLITE_IOERR_READ | extended result codes],
** [sqlite3_vtab_on_conflict()] [SQLITE_ROLLBACK | result codes].
*/
#define SQLITE_OK           0   /* Successful result */
/* beginning-of-error-codes */
#define SQLITE_ERROR        1   /* SQL error or missing database */
#define SQLITE_INTERNAL     2   /* 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   /* A malloc() failed */
#define SQLITE_READONLY     8   /* Attempt to write a readonly database */
#define SQLITE_INTERRUPT    9   /* Operation terminated by sqlite3_interrupt()*/
#define SQLITE_IOERR       10   /* Some kind of disk I/O error occurred */
#define SQLITE_CORRUPT     11   /* The database disk image is malformed */
#define SQLITE_NOTFOUND    12   /* 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   /* 2nd parameter to sqlite3_bind out of range */
#define SQLITE_NOTADB      26   /* File opened that is not a database file */
#define SQLITE_NOTICE      27   /* Notifications from sqlite3_log() */
#define SQLITE_WARNING     28   /* Warnings from sqlite3_log() */
#define SQLITE_ROW         100  /* sqlite3_step() has another row ready */
#define SQLITE_DONE        101  /* sqlite3_step() has finished executing */
/* end-of-error-codes */

翻译

#define SQLITE_OK         0 /*成功结果*/
#define SQLITE_ERROR      1 /*SQL错误或缺少数据库*/
#define SQLITE_INTERNAL   2 /*SQLite中的内部逻辑错误*/
#define SQLITE_PERM       3 /*访问权限被拒绝*/
#define SQLITE_ABORT      4 /*回调例程请求中止*/
#define SQLITE_BUSY       5 /*数据库文件已锁定*/
#define SQLITE_LOCKED     6 /*数据库中的一个表被锁定*/
#define SQLITE_NOMEM      7 /*一个malloc()失败*/
#define SQLITE_READONLY   8 /*尝试写入只读数据库*/
#define SQLITE_INTERRUPT  9 /*由sqlite3_interrupt()终止的操作*/
#define SQLITE_IOERR      10 /*发生某种磁盘I/O错误*/
#define SQLITE_CORRUPT    11 /*数据库磁盘映像格式不正确*/
#define SQLITE_NOTFOUND   12 /*未知操作码sqlite3_interrupt()*/
#define SQLITE_FULL       13 /*插入失败,因为数据库已满*/
#define SQLITE_CANTOPEN   14 /*无法打开数据库文件*/
#define SQLITE_PROTOCOL   15 /*数据库锁协议错误*/
#define SQLITE_EMPTY      16 /*数据库为空*/
#define SQLITE_SCHEMA     17 /*数据库架构已更改*/
#define SQLITE_TOOBIG     18 /*字符串或BLOB超出大小限制*/
#define SQLITE_CONSTRAINT 19 /*由于约束冲突而中止*/
#define SQLITE_MISMATCH   20 /*数据类型不匹配*/
#define SQLITE_usage      21 /*库使用错误*/
#define SQLITE_NOLFS      22 /*使用主机不支持的操作系统功能*/
#define SQLITE_AUTH       23 /*授权被拒绝*/
#define SQLITE_FORMAT     24 /*辅助数据库格式错误*/
#define SQLITE_RANGE      25 /*第二个参数定义为sqlite3_bind超出范围*/
#define SQLITE_NOTADB     26 /*打开的不是数据库文件的文件*/
#define SQLITE_NOTICE     27 /*来自sqlite3_log()的通知*/
#define SQLITE_WARNING    28 /*来自sqlite3_log()的警告*/
#define SQLITE_ROW        100 /*sqlite3_step()已准备好另一行*/
#define SQLITE_DONE       101 /*sqlite3_step()已完成执行*/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要下载SQLite库的相关文件,包括sqlite3.h、sqlite3.dll和sqlite3.lib,可以按照以下步骤进行: 1. 打开SQLite的官方网站(https://www.sqlite.org/)。 2. 在网站的主页上,点击"Download"(下载)按钮。 3. 在下载页面中,找到相应版本的SQLite库。通常会提供不同的版本,包括预编译好的二进制文件和源代码。 4. 选择适合你系统的版本。如果你使用的是Windows操作系统,通常可以选择一个预编译好的二进制版本。确保选择与你系统架构(32位或64位)相匹配的版本。 5. 下载预编译版本的SQLite库。对于Windows系统,通常会提供一个压缩文件,其中包含sqlite3.h、sqlite3.dll和sqlite3.lib文件。 6. 解压下载的压缩文件。 7. 在解压后的文件夹中,你会找到sqlite3.h文件,该文件是SQLite库的头文件。 8. 在同一文件夹中,你会找到sqlite3.dll文件,该文件是SQLite库的动态链接库文件。你可以将该文件复制到你的项目或应用程序所需的位置。 9. 如果你需要在Visual Studio等IDE中开发应用程序,可以使用sqlite3.lib文件。将该文件添加到你的项目中,以便在编译时链接SQLite库。 10. 现在,你可以在你的项目中包含sqlite3.h头文件,并在编译时链接sqlite3.lib文件,以使用SQLite库的功能。 请注意,这些步骤仅适用于Windows操作系统。在其他操作系统上,可能需要采取不同的步骤或使用不同的文件。建议在下载和使用SQLite库时,参考官方文档和相关资源。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值