Informix Error -2866: The NOW attribute may be assigned only to datetime columns.
Cause and resolution
The NOW attribute may be assigned only to datetime columns.
This message is not in use in any current product. SQL does not support any NOW attribute or function; use the CURRENT function.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-2866 is a legacy message: per the official guidance, it is not in use in any current product,
because SQL does not support any NOW attribute or function — the CURRENT function is used
instead.
- Encountering this message at all is not expected in a current product, per the official
guidance, since no current version of SQL has a
NOWattribute/function to trigger it.
Solutions / Resolution
- Use the
CURRENTfunction instead ofNOW, per the official guidance, wherever the current date/time is needed.
Examples
Using CURRENT in place of NOW
ATTRIBUTES
order_date = order_date, DEFAULT = CURRENT;
Diagnostic Checks
- Check for any lingering
NOWreference in the form specification, and replace it withCURRENT.
Related Errors / Related Topics
- -2867 — "The CURRENT attribute may be assigned only to datetime columns." A related,
currently-applicable error covering the same DATETIME-only assignment rule for the
CURRENTfunction that actually exists in current products.
This is a legacy message not triggered by any current product — SQL uses CURRENT, not NOW.