Informix Error -885: Invalid or NULL utc time given to dbinfo(utc_to_datetime).
Cause and resolution
Invalid or NULL utc time given to dbinfo(utc_to_datetime).
You attempted to pass an invalid or NULL value to the dbinfo() function. Make sure you pass a valid or non-null value to the dbinfo() function.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-885 fires when DBINFO('utc_to_datetime', ...)'s second argument (the UTC time value to
convert) is NULL or otherwise invalid — per the official guidance, a valid, non-NULL value is
required.
- The second argument evaluating to NULL, per the official guidance — for example, a variable that was never assigned, or a subquery that returned no rows.
- A value that isn't a valid UTC time representation for what
utc_to_datetimeexpects, per the official guidance's more general framing.
Solutions / Resolution
- Pass a valid, non-null value to the
DBINFO()function, per the official guidance. - Trace the second argument's source back to confirm it's guaranteed non-NULL and correctly
formatted by the time
DBINFO('utc_to_datetime', ...)evaluates it.
Examples
The disallowed attempt
DEFINE v_utc INT;
-- v_utc was never assigned a value; it's NULL
SELECT DBINFO('utc_to_datetime', v_utc) FROM systables WHERE tabid = 1;
-- -885: v_utc is NULL
Corrected
DEFINE v_utc INT;
LET v_utc = DBINFO('utc_current');
SELECT DBINFO('utc_to_datetime', v_utc) FROM systables WHERE tabid = 1;
Diagnostic Checks
- Trace the value passed as the second argument to confirm it's non-NULL and valid before
the
DBINFO('utc_to_datetime', ...)call.
Related Errors / Related Topics
- -726 — "First argument to dbinfo() must be a quoted string constant." A related
DBINFO()argument-validation error, on the first argument rather than the second. - -728 — "Unknown first argument of dbinfo(argument)." A related
DBINFO()error, about the first argument not matching a recognized value at all.
Confirm the UTC time value passed is non-NULL and valid before the call.