ORA-01812: year may only be specified once

ORA-01812: year may only be specified once

Oracle PL/SQL error message: ORA-01812: year may only be specified once.

Cause:

More than one year format code was listed in a date specification. Only one of the following year format codes may be specified in a date: YYYY, YYY, YY, Y.

Solution:

Remove all but one year format from the date specification.

Example:

SELECT TO_DATE('2015.12.29','Y YYY/MM/DD') FROM dual;

Output:

ORA-01812: year may only be specified once




Correct:

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

Output:

29-DEC-2015 00:00:00