Informix Error -4652
-4652 The function function name can only be used within an INPUT or
CONSTRUCT statement.The function shown is being used outside of an INPUT or CONSTRUCT statement. However, it returns a result that is only meaningful in the context of INPUT or CONSTRUCT. Review the code to make sure that an END INPUT or END CONSTRUCT statement has not been misplaced. Review the operation and use of the function to make sure you understand it.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4652 fires when a function meaningful only inside INPUT/CONSTRUCT (such as one returning
the current field name) is called outside that context — per the official guidance.
- The function is called outside any
INPUT/CONSTRUCTstatement's scope, per the official guidance — the direct, named cause. - An
END INPUT/END CONSTRUCTstatement is misplaced, per the official guidance — a specific, named contributing scenario that would close the scope earlier than intended.
Solutions / Resolution
- Review the code to make sure an
END INPUT/END CONSTRUCTstatement hasn't been misplaced, per the official guidance. - Review the operation and use of the function, per the official guidance, to confirm it's only being called where it's meaningful.
Examples
Calling an INPUT-only function outside INPUT
FUNCTION afterEntry()
LET f = FIELD_TOUCHED("order_id")
-- -4652: this function is only meaningful inside INPUT/CONSTRUCT
END FUNCTION
Diagnostic Checks
- Trace the call site backward to confirm it's genuinely within an
INPUT/CONSTRUCTstatement's scope, and check for a misplacedEND INPUT/END CONSTRUCT.
Related Errors / Related Topics
- -4627 — "The program cannot exit an INPUT statement at this point because it is not
within an INPUT statement." A related
INPUT-scope error, aboutEXIT INPUTrather than a scope-restricted function call. - -4488 — "The program cannot CONTINUE or EXIT statement-type at this point because it is not immediately within statement-type statement." The general version of this class of scope-mismatch condition.
A function meaningful only inside INPUT/CONSTRUCT was called outside that scope — check
for a misplaced END INPUT/END CONSTRUCT.