Informix Error -4062: Warning: Informal function "name" returns (or is expected to return) different number of results at different places.
Cause and resolution
Warning: Informal function "name" returns (or is expected to return) different number of results at different places.
The function name is called at more than one place in this source module, and it is implied to return different numbers of arguments. Possibly this correct; it is possible to write functions that return different numbers of values in different circumstances. However, you should check that this is the case and that the expected number of values will be returned in each case.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4062 is a compiler warning, not necessarily an error: per the official guidance, an informal function is called in more than one place and implied to return different numbers of values — this can be correct, since informally-declared functions may legitimately return different counts in different circumstances.
- An informal function called at multiple sites implying different result counts, per the official guidance — the direct cause; may be intentional.
Solutions / Resolution
- Check that this is genuinely intended, per the official guidance, confirming the expected number of values is returned in each calling circumstance.
Examples
Reviewing an informal function's varying returns
Check every call site of the function and confirm each expects the actual number of values that function's logic returns in that circumstance, rather than assuming a fixed count.
Diagnostic Checks
- Check every call site of the named informal function, and confirm the number of values expected matches what the function actually returns there.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4062 in this set yet.
An informal function appears to return different numbers of results at different call sites — verify this is intentional and each call site expects the right count.