What does HRESULT 0x87AF0313 (SQLITE_E_CONSTRAINT_FOREIGNKEY) mean?

 
Previous Next
SQLITE_E_CANTOPEN_FULLPATH SQLITE_E_READONLY_DBMOVED

SQLITE_E_CONSTRAINT_FOREIGNKEY

SQLITE_E_CONSTRAINT_FOREIGNKEY corresponds to SQLITE_CONSTRAINT_FOREIGNKEY. A child row refers to a parent row that does not exist, or a parent row was changed or removed while referenced by child rows.

What to check

  • Confirm that foreign key enforcement is enabled for the connection; it is configured per connection in SQLite.
  • Use PRAGMA foreign_key_check to locate existing violations in a copy or controlled maintenance session.
  • Review the intended parent/child lifecycle and any ON DELETE or ON UPDATE action before changing data.
PRAGMA foreign_keys;
PRAGMA foreign_key_check;

SQLite: SQLITE_CONSTRAINT_FOREIGNKEY

SQLite: Foreign Key Support

SQLite: Foreign Key Clauses


Looking for a different code? Search another status or error code.