Informix Error -414
-414 Insert attempted on NULL cursor.
This PUT statement specifies a cursor that is invalid. Possibly the cursor has been freed with the FREE statement, or possibly an automatic re-prepare has been attempted while opening the cursor but that operation failed, leaving the cursor unavailable, or possibly the cursor data structure has been overwritten in memory.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-414 is the insert-cursor counterpart of -401: a PUT statement specifies a cursor whose
underlying data structure is invalid, rather than simply unopened.
- The cursor was explicitly freed with
FREE, and aPUTwas attempted against it afterward. - An automatic re-prepare failed while opening the cursor, leaving the cursor's internal structure unavailable even though the code believes it succeeded.
- The cursor data structure was overwritten in memory — a more serious client-side memory bug, potentially in embedded SQL/ESQL-C code managing cursor handles directly.
Solutions / Resolution
- Check whether the cursor was freed (
FREE) before thePUT— don't attempt to use a cursor after freeing it. - Check for an automatic re-prepare failure around the
OPENstep. - If memory corruption is suspected, review the application's own memory management around cursor handles in embedded SQL/ESQL-C client code, since this can point to a client-side bug rather than a server-side one.
Examples
Confirming the cursor wasn't freed before a PUT
DECLARE curs1 CURSOR FOR INSERT INTO orders (order_id, customer_id) VALUES (?, ?);
OPEN curs1;
PUT curs1 (1001, 42);
FREE curs1;
PUT curs1 (1002, 43);
-- -414: curs1 was freed before this PUT
Diagnostic Checks
- Check for a
FREEstatement on the cursor before the failingPUT. - Review embedded SQL/ESQL client code for memory-management issues around cursor handles if corruption is suspected.
Related Errors / Related Topics
- -401 — "Fetch attempted on NULL cursor." The closest sibling — the same underlying invalid-
cursor-structure condition, applied to
FETCHinstead ofPUT. - -413 — "Insert attempted on unopen cursor." A related, less severe insert-cursor error — a cursor simply not currently open, versus this error's invalid/corrupted structure.
Same underlying causes as -401 — a freed cursor, a failed re-prepare, or (rarer) client-side
memory corruption — applied here to PUT instead of FETCH.