ORA-01810: format code appears twice

ORA-01810: format code appears twice

Oracle PL/SQL error message: ORA-01810: format code appears twice.

Cause:

A format code was listed twice in a date specification. Each format code may be specified only once in the function TO_DATE.

Solution:

Remove the duplicate format code from the date specification, then retry the operation.




Example:

SELECT TO_DATE('2015.12.28','YY YY/MM/DD') FROM dual;

Output:

ORA-01810: format code appears twice

Correct:

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

Output:

28-DEC-2015 00:00:00