Informix Error -1209: Without any delimiters, this date must contain exactly 6 or 8 digits.
Cause and resolution
Without any delimiters, this date must contain exactly 6 or 8 digits.
When a literal date value is entered in numeric form, not enclosed in quotes to make it a character string, it must be entered as a number of precisely 6 digits (representing mmddyy) or 8 digits (representing mmddyyyy). Because no punctuation is present, a date with any other number of digits is ambiguous; it cannot be divided into month, day, and year with certainty.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1209 fires when a numeric date value (entered without delimiters) has a digit count other than
6 or 8 — per the official guidance, an undelimited date must be exactly 6 digits (mmddyy) or 8
digits (mmddyyyy); any other length is ambiguous to parse into month, day, and year.
- A numeric date string with a digit count other than 6 or 8, per the official guidance — the direct, only cause, often a truncated or malformed year (e.g. a 3-digit year).
- A date value built by string concatenation that didn't pad or produce the expected 6- or 8-digit total.
Solutions / Resolution
- Ensure the undelimited numeric date has exactly 6 digits (
mmddyy) or 8 digits (mmddyyyy), per the official guidance. - If the exact format is ambiguous, use delimiters (e.g.
mm/dd/yyyy) instead of relying on the undelimited numeric form.
Examples
A malformed 7-digit date
INSERT INTO orders (order_id, order_date) VALUES (1, 1012024);
-- -1209: 7 digits is neither the 6-digit (mmddyy) nor 8-digit (mmddyyyy) form
Corrected
INSERT INTO orders (order_id, order_date) VALUES (1, '01/01/2024');
Diagnostic Checks
- Count the digits in the undelimited numeric date value, and confirm it's exactly 6 or 8.
Related Errors / Related Topics
- -1204 — "Invalid year in date." A related date-validity error, once the digit count is correct but the resulting year itself is invalid.
- -1205 — "Invalid month in date." A related date-validity error, for the month component.
- -1206 — "Invalid day in date." A related date-validity error, for the day component.
An undelimited numeric date must be exactly 6 or 8 digits — use delimiters instead if the format is ambiguous.