Informix Error -690
-690 Cannot read keys from referencing table table-name.
The referential constraint could not be validated. See the ISAM error for more information. If you are using cascading deletes, database logging must be on.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-690 fires when the server can't validate a referential constraint because it can't read the keys from the referencing (child) table — per the official guidance, the accompanying ISAM error carries the specific reason, and there's one specific, named requirement: if cascading deletes are in use, database logging must be on.
- Cascading deletes used on an unlogged database, per the official guidance — the specific, named requirement; cascading deletes require logging to be enabled.
- An underlying ISAM-level error while reading the referencing table's keys, per the official guidance's pointer to checking the accompanying ISAM error, for causes other than the logging requirement.
Solutions / Resolution
- If using cascading deletes, confirm the database has logging enabled, per the official
guidance — this is a hard requirement, not optional:
SELECT name, is_logging FROM sysmaster:sysdatabases WHERE name = 'target_db'; - Check the accompanying ISAM error code, per the official guidance, for causes other than the logging requirement.
- If logging is off and can't be turned on for this database, don't rely on cascading deletes — delete from the referencing table explicitly before deleting from the referenced table instead.
Examples
Checking whether logging is on
SELECT name, is_logging FROM sysmaster:sysdatabases WHERE name = 'stores7';
An explicit delete sequence, when cascading isn't available
DELETE FROM order_items WHERE order_id = 42;
DELETE FROM orders WHERE order_id = 42;
Diagnostic Checks
- Check
is_logginginsysmaster:sysdatabasesfirst, per the official guidance's specific named requirement for cascading deletes. - Check the accompanying ISAM error code for other causes if logging is confirmed on.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -690 in this set yet.
Check whether the database has logging enabled first — cascading deletes require it, per the official guidance's specific named requirement.