Informix Error -4147
-4147 A RETURN statement is required in this function.
The function was declared with a RETURNING clause that specified other than VOID, but no RETURN statement occurs in the body of the function.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4147 fires when a function is declared with a RETURNING clause specifying something other
than VOID, but its body contains no RETURN statement at all — per the official guidance,
this is a required statement whenever a non-VOID return type is declared.
- A non-
VOIDfunction with noRETURNstatement anywhere in its body, per the official guidance — the direct, only cause.
Solutions / Resolution
- Add a
RETURNstatement that provides a value matching the function's declared return type.
Examples
A non-VOID function with no RETURN
FUNCTION compute() RETURNING INTEGER
LET x = 1 + 1
-- -4147: no RETURN statement anywhere in this function
END FUNCTION
Corrected
FUNCTION compute() RETURNING INTEGER
LET x = 1 + 1
RETURN x
END FUNCTION
Diagnostic Checks
- Check every function declared with a non-
VOIDRETURNINGclause for at least oneRETURNstatement in its body.
Related Errors / Related Topics
- -4067 — "This RETURN statement must provide a value." A related
RETURN-statement error, about an existingRETURNmissing its value, rather than noRETURNexisting at all.
A non-VOID function has no RETURN statement at all — add one that provides a value.