Informix Error -240
-240 Could not delete a row.
The database server cannot finish execution of a DELETE statement. Roll back the current transaction; then check the accompanying ISAM error code for more specific information.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-240 is a generic wrapper around a failed DELETE — the accompanying ISAM error code carries the
specific cause, which could be any of several underlying conditions.
- A locking conflict — the same lock-conflict family as -233 (-107, -113, -134, -143, -144, -154), encountered while trying to delete rather than read.
- Disk space or storage issues interrupting the delete operation.
- Referential integrity constraints — a row that can't be deleted because dependent rows in another table still reference it via a foreign key (though this often surfaces as its own distinct error depending on version; check the accompanying code to confirm).
- General corruption or storage issues, consistent with other severe conditions elsewhere in this catalogue.
Solutions / Resolution
- Roll back the current transaction, per the official guidance.
- Check the accompanying ISAM error code for the specific cause, and address it using that code's own guidance elsewhere in this catalogue.
- If a lock conflict, apply the same retry-with-backoff approach as -233/-107.
- If a referential-integrity issue, address dependent rows first — delete or reassign them before retrying the delete on the parent row.
Examples
Checking the accompanying code first
-- The specific ISAM error code accompanying -240 determines the fix:
-- -107/-113/-134/-143/-144/-154: a lock conflict — retry with backoff
-- a referential-integrity-specific code: address dependent rows first
Diagnostic Checks
- Check the accompanying ISAM error code for the specific underlying cause.
- Check for dependent rows in other tables if a referential integrity issue is suspected.
Related Errors / Related Topics
- -233 — "Cannot read record that is locked by another user." The closest structural sibling — the same accompanying-ISAM-code wrapper pattern, for reads instead of deletes.
- -238 — "Cannot commit work." Another DML/transaction-lifecycle generic wrapper in the same general family.
Check the accompanying ISAM error code before anything else — -240 alone only says the delete failed, not why.