Informix Error -4338: The symbol variable-name has already been defined once as a parameter.
Cause and resolution
The symbol variable-name has already been defined once as a parameter.
The name that is shown appears in the parameter list of the FUNCTION statement and in at least two DEFINE statements within the function body. Only one appearance in a DEFINE statement is permitted.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4338 fires when a function parameter is defined more than once in DEFINE statements inside
the function body — per the official guidance, only one DEFINE appearance per parameter is
permitted.
- A function parameter defined in more than one
DEFINEstatement, per the official guidance — the direct, only cause.
Solutions / Resolution
- Remove the duplicate
DEFINEstatement for the parameter.
Examples
A parameter defined twice
FUNCTION save(order_id)
DEFINE order_id INTEGER
DEFINE order_id INTEGER
-- -4338: order_id is already defined above
END FUNCTION
Corrected
FUNCTION save(order_id)
DEFINE order_id INTEGER
END FUNCTION
Diagnostic Checks
- Check every function parameter for more than one
DEFINEstatement inside the function body, and remove the duplicate.
Related Errors / Related Topics
- -4336 — "The parameter variable-name has not been defined within the function or
report." The mirror-image error, about a parameter with no
DEFINEat all rather than more than one. - -4319 — "The symbol variable-name has been defined more than once." A related general duplicate-definition error, of which this is the parameter-specific case.
A function parameter is defined more than once — remove the duplicate DEFINE.