In SQLite, the return values of the Sqlite3_exec () and Sqlite3_prepare () two core methods that execute the SQL statements are integer data, so when the program executes an error, we can determine the cause of the error based on the integer data returned. Here is the error code for SQLite:
1 #defineSQLITE_OK 0/* success | Successful result */2 /*error code start*/3 #defineSqlite_error 1/* SQL error or lost database | SQL error or missing database */4 #defineSqlite_internal 2/* SQLite Internal Logic Error | Internal logic Error in SQLite */5 #defineSqlite_perm 3/* Deny access | Access Permission denied */6 #defineSqlite_abort 4/* Callback function request Cancel Operation | Callback routine requested an abort * *7 #defineSqlite_busy 5/* database file is locked | The database file is locked */8 #defineSqlite_locked 6/* A table in the database is locked | A table in the database is locked */9 #defineSqlite_nomem 7/* a malloc () function call failed | A malloc () failed */Ten #defineSqlite_readonly 8/* Attempt to write to a read-only database | Attempt to write a readonly database */ One #defineSqlite_interrupt 9/* Operation interrupted by Sqlite3_interupt () function | Operation terminated by Sqlite3_interrupt () */ A #defineSqlite_ioerr 10/* Some disk I/O errors occur | Some kind of disk I/O error occurred */ - #defineSqlite_corrupt 11/* Database disk image is incorrect | The database disk image is malformed */ - #defineUnknown operand in sqlite_notfound/* Sqlite3_file_control () | Unknown opcode in Sqlite3_file_control () */ the #defineSqlite_full 13/* Because the database is full causes insert failure | Insertion failed because database is full */ - #defineSqlite_cantopen 14/* Unable to open database file | Unable to open the database file */ - #defineSqlite_protocol 15/* Database Lockout protocol error | Database Lock protocol Error */ - #defineSqlite_empty 16/* Database is empty | Database is empty */ + #defineSqlite_schema 17/* Data structure changed | The database schema changed */ - #defineSqlite_toobig 18/* string or binary data exceeds size limit | String or BLOB exceeds size limit */ + #defineSqlite_constraint 19/* Canceled due to constraint violation | Abort due to constraint violation */ A #defineSqlite_mismatch 20/* Data Type mismatch | Data Type Mismatch */ at #defineSqlite_misuse 21/* Incorrect Library usage | Library used incorrectly */ - #defineSqlite_nolfs 22/* Using features not supported by the operating system | Uses OS features not supported on Host */ - #defineSqlite_auth 23/* Authorization Failed | Authorization denied */ - #defineSqlite_format 24/* Additional database format Error | Auxiliary database format Error */ - #defineSqlite_range 25/* Second parameter passed to Sqlite3_bind () Out of range | 2nd parameter to sqlite3_bind out of range */ - #defineSQLITE_NOTADB 26/* The file that is opened is not a database file | File opened a database file */ in #defineSqlite_row/* SQLITE3_STEP () has produced a row result | Sqlite3_step () have another row ready */ - #defineSqlite_done 101/* SQLITE3_STEP () Complete Execution | Sqlite3_step () has finished executing */
SQLite error code