ORA-01821: date format not recognized

ORA-01821: date format not recognized Oracle PL/SQL error message: ORA-01821: date format not recognized. Cause: A date specification contained an invalid format code. Solution: Check that only valid date format codes are specified. Example: SELECT TO_CHAR(sysdate,’YYYY/MM/DD H:MI:SS’) FROM dual; Output: ORA-01821: date format not recognized Correct: SELECT TO_CHAR(sysdate,’YYYY/MM/DD HH24:MI:SS’) FROM dual; Output: 2015/12/26 09:56:04

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…(Continue Reading)

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’)…(Continue Reading)

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…(Continue Reading)

ORA-01843: not a valid month

ORA-01843: not a valid month Oracle PL/SQL error message: ORA-01843: not a valid month. Cause: A date specified an invalid month. Valid months are: January-December, for format code MONTH, and Jan-Dec, for format code MON. Solution: Enter a valid month value in the correct format. Example: SELECT TO_DATE(‘2015.26.12′,’YYYY.MM.DD’) FROM dual; Output: ORA-01843: not a valid…(Continue Reading)