Informix Error -4108
-4108 An expression of type DATE 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 DATE expression.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4108 fires when a context requiring a DATE 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-
DATEexpression used whereDATEis required, per the official guidance — the direct, only cause.
Solutions / Resolution
- Supply a genuine
DATEexpression, converting the value first if needed.
Examples
A non-DATE expression where one is required
EVENT MyEvent(d DATETIME YEAR TO SECOND)
-- -4108: if d is used somewhere requiring plain DATE
Corrected
EVENT MyEvent(d DATE)
Diagnostic Checks
- Check the expression's actual type against the context requiring
DATE, 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 ofDATE. - -4107 — "An expression of type INTEGER or SMALLINT is expected." The same
type-requirement pattern applied to integer types instead of
DATE. - -4109 — "An expression of type DATE or DATETIME is expected." The same
type-requirement pattern, accepting either
DATEorDATETIME.
A DATE expression is required but something else was found — supply or convert to a genuine
DATE value.