Informix Error -4412: Values from the RUN command can be returned only to INTEGER or SMALLINT variables.
Cause and resolution
Values from the RUN command can be returned only to INTEGER or SMALLINT variables.
The RUN command only returns the integer return code from the program that was executed. No automatic conversion of data occurs in this case; its result must be assigned to an integer variable.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4412 fires when RUN's return code is captured into a non-integer variable — per the
official guidance, RUN only returns the executed program's integer return code, and no
automatic conversion happens.
RUN's return code captured into a variable that isn'tINTEGER/SMALLINT, per the official guidance — the direct, only cause.
Solutions / Resolution
- Assign the result to an
INTEGER/SMALLINTvariable.
Examples
Capturing RUN's result into a non-integer variable
DEFINE rc CHAR(5)
RUN "myscript.sh" RETURNING rc
-- -4412: rc must be INTEGER or SMALLINT
Corrected
DEFINE rc INTEGER
RUN "myscript.sh" RETURNING rc
Diagnostic Checks
- Check the type of every variable receiving a
RUNreturn code, and confirm it'sINTEGER/SMALLINT.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4412 in this set yet.
RUN's return code is captured into a non-integer variable — use INTEGER/SMALLINT
instead.