Exception constraint failed [0x1555]: unique constraint failed when performing insert operation
SQLite unique constraint failed
Locate on a table field, which is the primary key of the table
Reason: the primary key field value in the inserted data already exists in the table
Solution: readjust the value of the primary key field in the insert statement to ensure the uniqueness of the constraint
In SQLite, execute SQLite3 of SQL statement_ Exec () and SQLite3_ The return value of the two core methods of prepare() is an integer data. Therefore, when there is an error in the program execution, we can judge the cause of the error according to the integer data returned by the execution. Here is the SQLite error code:
C++ Code
one 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
#define SQLITE_ OK 0 /*Successful result*/
#define SQLITE_ ERROR one /*SQL error or missing database*/
#define SQLITE_ INTERNAL two /*SQLite internal logic error*/
#define SQLITE_ PERM three /*Access denied*/
#define SQLITE_ ABORT four /*Callback function request cancel operation*/
#define SQLITE_ BUSY five /*The database file is locked*/
#define SQLITE_ LOCKED six /*A table in the database is locked*/
#define SQLITE_ NOMEM seven /*A malloc() function call failed | amalloc() failed*/
#define SQLITE_ READONLY eight /*Attempt to write to a read-only database*/
#define SQLITE_ INTERRUPT nine /*The operation is called SQLite3_ Interupt() function interrupt | operationterminated byite3_ interrupt()*/
#define SQLITE_ IOERR ten /*Some disk I/O errors have occurred*/
#define SQLITE_ CORRUPT eleven /*The Database disk image is malformed*/
#define SQLITE_ NOTFOUND twelve /*sqlite3_ file_ Unknown operand | unknownopcodeinite3 in control()_ file_ control()*/
#define SQLITE_ FULL thirteen /*Insertion failed because the database is full*/
#define SQLITE_ CANTOPEN fourteen /*Unable to open the database file*/
#define SQLITE_ PROTOCOL fifteen /*Database lock protocol error*/
#define SQLITE_ EMPTY sixteen /*Database empty*/
#define SQLITE_ SCHEMA seventeen /*The database schema changed*/
#define SQLITE_ TOOBIG eighteen /*String or binary data exceeds size limit*/
#define SQLITE_ CONSTRAINT nineteen /*Cancellation due to restraint violation*/
#define SQLITE_ MISMATCH twenty /*Datatype mismatch*/
#define SQLITE_ MISUSE twenty-one /*Incorrect library use*/
#define SQLITE_ NOLFS twenty-two /*Use OS features not supported on host*/
#define SQLITE_ AUTH twenty-three /*Authorization denied*/
#define SQLITE_ FORMAT twenty-four /*Additional database format error*/
#define SQLITE_ RANGE twenty-five /*Pass to SQLite3_ The second parameter of bind() is out of range | 2ndparametertosqlite3_ bindoutofrange*/
#define SQLITE_ NOTADB twenty-six /*The opened file is not a database file*/
#define SQLITE_ ROW one hundred /*sqlite3_ Step () has produced a row result | SQLite3_ step()hasanotherrowready*/
#define SQLITE_ DONE one hundred and one /*sqlite3_ Step() completes the execution operation | SQLite3_ step()hasfinishedexecuting*/ |
Similar Posts:
- ORA-02292: integrity constraint
- Solution of data truncated for column ‘xxx’ in MySQL
- [How to Solve] SQLite database error: no such column
- Solution to SQLite error database is locked
- SVN:sqlite[S5]:database is locked [How to Solve]
- [Solved] MySQL ERROR 1062 (23000): Duplicate entry ‘0’ for key ‘PRIMARY’
- [Solved] The length of the data truncation done by springboothinesdata for the column.
- [Solved] MYSQL Error: Cannot delete or update a parent row: a foreign key constraint fails
- svn cleanup failed–previous operation has not finished [Solved]
- 【complier/asm】impossible constraint in ‘asm’ error