Informix Error -35224: INTO phrase cannot appear within a DECLARE CURSOR statement.
Cause and resolution
INTO phrase cannot appear within a DECLARE CURSOR statement.
Use of the INTO phrase in a DECLARE cursor can result in unpredictable runtime errors. It is recommended that you move the INTO phrase to the OPEN and/or FETCH procedures.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-35224 fires when an INTO phrase appears inside a DECLARE CURSOR statement — per the official
guidance, using INTO there can cause unpredictable runtime errors.
- An
INTOphrase placed in theDECLARE CURSORstatement itself, per the official guidance — the direct, only cause.
Solutions / Resolution
- Move the
INTOphrase to theOPENand/orFETCHprocedures, per the official guidance — the documented, recommended fix.
Examples
N/A
No specific triggering statement is documented beyond an INTO phrase placed directly in
DECLARE CURSOR.
Diagnostic Checks
- Check the
DECLARE CURSORstatement for anINTOphrase and confirm it's moved toOPEN/FETCHinstead.
Related Errors / Related Topics
- -35201 — "Cursor name must be an identifier." Another cursor-declaration error.
- -35203 — "Cursor cursor name already defined." A related cursor restriction.
- -35213 — "No cursor declaration for procedure name." A related cursor-usage error.
- -35225 — "Object reference... cannot appear in a dynamic cursor declaration." A related restriction on what may appear inside a cursor declaration.
An INTO phrase was placed directly in DECLARE CURSOR, which can cause unpredictable runtime
errors — move it to the OPEN and/or FETCH procedures instead.