Informix Error -4121: Reports cannot be invoked through the CALL statement or in function call expressions.
Cause and resolution
Reports cannot be invoked through the CALL statement or in function call expressions.
This statement attempts to call a report as if it were a function. Although a report has the general form of a function definition, it cannot be used like one. Check the names of functions that are called in this statement; one is a report. If you meant to send a row of data to the report, use the OUTPUT TO REPORT statement.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4121 fires when a statement tries to call a report as if it were a function — per the official guidance, a report has the general form of a function definition, but it can't be invoked like one.
- A report name used in a
CALLstatement or function-call expression, per the official guidance — the direct, only cause.
Solutions / Resolution
- Check the names of functions called in the statement for one that's actually a report, per the official guidance.
- If sending a row of data to the report was intended, use
OUTPUT TO REPORTinstead, per the official guidance.
Examples
Calling a report like a function
CALL order_report(rec)
-- -4121: order_report is a REPORT, not a FUNCTION
Corrected
OUTPUT TO REPORT order_report(rec)
Diagnostic Checks
- Check whether the called name is actually a report, and use
OUTPUT TO REPORTinstead ofCALLif so.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4121 in this set yet.
A report is called like a function — use OUTPUT TO REPORT to send data to it instead.