I'm using QSqlRelationalTableModel and QtableView to insert data to SQLite Database, I get an error message: constraint failed unable to fetch row; when I insert data into table has Relation. I don’t know how to fix this problem.
Help me!
I'm using QSqlRelationalTableModel and QtableView to insert data to SQLite Database, I get an error message: constraint failed unable to fetch row; when I insert data into table has Relation. I don’t know how to fix this problem.
Help me!
Very hard to tell without seeing your database schema and what you are doing. Clearly you try to do something, which is forbidden in your schema, e.g. insert a 0 in a column, which has the constraint 'NOT NULL', or adding duplicate values in a column with the constraint 'UNIQUE'. Unfortunately SQLite is not able to tell exactly which constraint you are violating and why.
I understand SQL works. I’m sure that no cases like you said above.
Bookmarks