Informix Error -263
-263 Could not lock row for UPDATE.
This statement, probably a FETCH statement that names a cursor declared FOR UPDATE, failed because the row it should have fetched could not be locked. Check the accompanying ISAM error code (usually -107, -113,-134, -143, -144, or -154) for more information. Probably another program is using the row (-107) or table (-113). You can use SET LOCKMODE TO WAIT to eliminate these errors, but detection of deadlock (-143 or -154) and lock table full (-134) can still occur.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-263 is the FETCH-on-a-FOR UPDATE-cursor member of the same lock-conflict wrapper family as
-233 and -250 — the official text names the identical set of accompanying codes: -107,
-113, -134, -143, -144, or -154.
- Another program using the row (-107) or the table (-113) — the most common causes.
- Lock-table exhaustion (-134) or deadlock (-143/-154) — less common, but the official
text notes these can still occur even with
SET LOCKMODE TO WAITin effect.
Solutions / Resolution
- Check the accompanying ISAM error code — the same six-code family as -233.
- Use
SET LOCKMODE TO WAITto eliminate the ordinary -107/-113 conflicts, per the official guidance. - Understand this doesn't eliminate everything — deadlock detection (-143/-154) and lock table exhaustion (-134) can still occur regardless of lock mode, and need their own specific handling per those codes' guidance.
- See -233 for the full retry/response strategy by accompanying code — it applies here without modification.
Examples
Using WAIT mode to reduce ordinary conflicts
SET LOCKMODE TO WAIT 5;
DECLARE cur1 CURSOR FOR SELECT * FROM orders WHERE status = 'pending' FOR UPDATE;
OPEN cur1;
FETCH cur1 INTO :rec;
-- waits up to 5 seconds for the lock instead of failing immediately
-- with -263/-107
Diagnostic Checks
- Check the accompanying ISAM error code to determine the exact cause and appropriate response, per -233's guidance.
Related Errors / Related Topics
- -233 — "Cannot read record that is locked by another user." The closest sibling — same
accompanying-code family, for a general read rather than a
FOR UPDATEcursor fetch. - -250 — "Cannot read record from file for update." Another close sibling in the same lock-conflict family.
See -233 for the complete response strategy by accompanying code — this is the same family,
specific to FETCH on a FOR UPDATE cursor.