Informix Error -4336: The parameter variable-name has not been defined within the function or report.
Cause and resolution
The parameter variable-name has not been defined within the function or report.
The name variable-name appears in the parameter list of the FUNCTION statement for this function. However, it does not appear in a DEFINE statement within the function. All parameters must be defined in their function before use. Possibly you wrote a DEFINE statement but did not spell variable-name the same way in both places.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4336 fires when a name in a FUNCTION statement's parameter list has no matching DEFINE
statement inside the function — per the official guidance, all parameters must be defined
within their function before use; a common cause is a spelling mismatch between the parameter
list and the DEFINE statement.
- A parameter with no matching
DEFINEinside the function, per the official guidance — the direct, only cause. - A spelling mismatch between the parameter name and its
DEFINE, per the official guidance — a specifically named cause.
Solutions / Resolution
- Add a
DEFINEstatement for the parameter inside the function, or correct a spelling mismatch between the parameter list and an existingDEFINE.
Examples
A parameter with a spelling mismatch
FUNCTION save(order_id)
DEFINE orderid INTEGER
-- -4336: "order_id" (the parameter) != "orderid" (the DEFINE)
END FUNCTION
Corrected
FUNCTION save(order_id)
DEFINE order_id INTEGER
END FUNCTION
Diagnostic Checks
- Check every parameter in the
FUNCTIONstatement's list against theDEFINEstatements inside the function body, and match their spelling exactly.
Related Errors / Related Topics
- -4333 — "The name has already been called with a different number of parameters." A related error; the official guidance for -4333 explicitly says to fix -4336 first when both appear together, since it often resolves -4333 as a side effect.
- -4338 — "The symbol variable-name has already been defined once as a parameter." The mirror-image error, about a parameter defined more than once rather than not at all.
A function parameter has no matching DEFINE inside the function — add one, checking for a
spelling mismatch first.