Informix Error -9714: OUT parameter can only be the last parameter of a routine.
Cause and resolution
OUT parameter can only be the last parameter of a routine.
When an OUT parameter is specified in the CREATE FUNCTION statement, it must be the last parameter and the only parameter with the OUT option.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-9714 fires when a CREATE FUNCTION statement's OUT parameter isn't the last, or only, parameter with the OUT option — per the official guidance.
- An OUT parameter not positioned last, per the official guidance — the first named cause.
- More than one OUT parameter, per the official guidance — the second named cause.
Solutions / Resolution
- Make the OUT parameter the last parameter, and the only one with the OUT option, per the official guidance.
Examples
An OUT parameter not last
CREATE FUNCTION my_func(a OUT INT, b INT) RETURNING INT ...; -- -9714
Corrected
CREATE FUNCTION my_func(b INT, a OUT INT) RETURNING INT ...;
Diagnostic Checks
- Check the parameter list for an OUT parameter's position, and move it to last, removing any other OUT parameters.
Related Errors / Related Topics
- -9715 — "A procedure cannot have any OUT parameters." A related OUT-parameter restriction, on procedures not being allowed to use OUT at all rather than positioning.
An OUT parameter wasn't the last (or only) OUT parameter — reposition it.