Informix Error -4107
-4107 An expression of type INTEGER or SMALLINT is expected.
In an EVENT statement, a function definition or declaration, an EXTERNAL REPORT statement, a HANDLER statement, a function invocation, or just an expression, the compiler found something other than a INTEGER or SMALLINT expression.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4107 fires when a context requiring an INTEGER/SMALLINT expression instead finds
something else — per the official guidance, this can occur in an EVENT statement, a function
definition or declaration, an EXTERNAL REPORT statement, a HANDLER statement, a function
invocation, or a plain expression.
- A non-
INTEGER/SMALLINTexpression used where one is required, per the official guidance — the direct, only cause.
Solutions / Resolution
- Supply a genuine
INTEGERorSMALLINTexpression, converting the value first if needed.
Examples
A non-integer expression where one is required
EVENT MyEvent(qty DECIMAL)
-- -4107: if qty is used somewhere requiring INTEGER/SMALLINT
Corrected
EVENT MyEvent(qty INTEGER)
Diagnostic Checks
- Check the expression's actual type against the context requiring
INTEGER/SMALLINT, and convert it if necessary.
Related Errors / Related Topics
- -4106 — "An expression of type DATETIME is expected." The same type-requirement pattern
applied to
DATETIMEinstead of integer types. - -4108 — "An expression of type DATE is expected." The same type-requirement pattern
applied to
DATEinstead of integer types. - -4109 — "An expression of type DATE or DATETIME is expected." The same
type-requirement pattern, accepting either
DATEorDATETIME.
An INTEGER/SMALLINT expression is required but something else was found — supply or
convert to a genuine integer value.