HomePrivacy PolicyFeedbackLink to usSite Map

Oracle/PLSQL: ORA-01861 Error


Error:

ORA-01861: literal does not match format string

Cause:

You tried to enter a literal with a format string, but the length of the format string was not the same length as the literal.

Action:

The options to resolve this Oracle error are:
  1. Re-enter the literal so that it matches the format string.

For example, if you tried to execute the following statement:

SELECT to_date('20041308','yyyy/mm/dd')
FROM dual;


You would receive the following error message:


You could correct the SQL statement as follows:

SELECT to_date('2004/08/13','yyyy/mm/dd')
FROM dual;


As a general rule, if you are using the to_date, to_timestamp, to_char, and similar functions, make sure that the literal that you provide matches the format string that you've specified.

For a listing of all Oracle functions, go to our Oracle functions webpage.