ORA-01861: literal does not match format string

ORA-01861: literal does not match format string

Oracle PL/SQL error message: ORA-01861: literal does not match format string.

Cause:

Literals in the input must be the same length as literals in the format string (with the exception of leading white space). If the “FX” modifier has been toggled on, the literal must match exactly, with no extra white space.

Solution:

Correct the format string to match the literal.

Example:

SELECT TO_DATE('20151227','YYYY/MM/DDD') FROM dual;

Output:

ORA-01861: literal does not match format string

Correct:

SELECT TO_DATE('20151227','YYYY/MM/DD') FROM dual;

Output:

27-DEC-2015 00:00:00