Informix Error -1352
-1352 name may not be used as both a function (or report) name and
a variable name.The name that is shown has been defined at least two ways. Names at the global or module level (function names, report names, and names of global or module variables) must be unique. Locate all the definitions of this name, and change all but one of them.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1352 fires when a name is defined as both a function/report and a variable — per the official guidance, function names, report names, and variable names must all be unique at the global or module level.
- A name used for both a function/report and a variable, per the official guidance — the direct, only cause.
- A name accidentally reused across separate source modules in a multimodule program, similar to -1351's cross-module collision case.
Solutions / Resolution
- Identify all definitions of the duplicate name and modify all but one of them, per the official guidance.
Examples
A name used as both a function and a variable
FUNCTION order_total()
RETURN 100;
END FUNCTION
DEFINE order_total DECIMAL(10,2);
-- -1352: order_total is defined as both a function and a variable
Corrected
FUNCTION order_total()
RETURN 100;
END FUNCTION
DEFINE v_order_total DECIMAL(10,2);
Diagnostic Checks
- Search the entire program (across all modules) for every occurrence of the name, and confirm it's used consistently as only one kind of identifier.
Related Errors / Related Topics
- -1351 — "The function (or report) name has already been defined." A related naming- collision error, between a function and a report specifically rather than a function/report and a variable.
A name is used as both a function/report and a variable — rename all but one definition.