Informix Error -26056: Function cursor (%s) in SPL cannot have WITH HOLD option
Cause and resolution
Function cursor (%s) in SPL cannot have WITH HOLD option
In SPL routines, the WITH HOLD option is not allowed for a function cursor declared for the EXECUTE PROCEDURE or EXECUTE FUNCTION statement. Omit the WITH HOLD keywords while declaring this cursor.
Only ESQL/C routines support function cursors WITH HOLD.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-26056 fires when an SPL function cursor for EXECUTE PROCEDURE/EXECUTE FUNCTION is
declared WITH HOLD — per the official guidance.
- A function cursor declared
WITH HOLDinside an SPL routine, per the official guidance — the direct, only cause;WITH HOLDon function cursors is only supported in ESQL/C, not SPL.
Solutions / Resolution
- Omit the
WITH HOLDkeywords when declaring the cursor in SPL, per the official guidance.
Examples
A function cursor with WITH HOLD in SPL
DECLARE c_result CURSOR WITH HOLD FOR
EXECUTE FUNCTION my_func();
-- -26056: WITH HOLD not allowed on a function cursor in SPL
Corrected
DECLARE c_result CURSOR FOR
EXECUTE FUNCTION my_func();
Diagnostic Checks
- Check every function cursor declared inside an SPL routine for
WITH HOLD, and remove it.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -26056 in this set yet.
An SPL function cursor was declared WITH HOLD — that option is only supported in ESQL/C;
omit it in SPL.