What should I do if ora01843 invalid month appears?
When executing the following SQL statement
select TO_DATE('01-FEB-1988', 'DD-MON-YYYY') from dual;
the following error occurred:
Restart I checked the date format of the current system time and found the following:
Execution:
SELECT TO_CHAR(sysdate, 'DD-MON-YYYY','NLS_DATE_LANGUAGE = ''SIMPLIFIED CHINESE''') Chn, TO_CHAR(sysdate, 'DD-MON-YYYY', 'NLS_DATE_LANGUAGE = American') Ame, TO_CHAR(sysdate, 'DD-MON-YYYY', 'NLS_DATE_LANGUAGE = Japanese') Jap, TO_CHAR(sysdate, 'DD-MON-YYYY', 'NLS_DATE_LANGUAGE = english') Eng FROM DUAL;
The following results appear:
By SQL statement , it can be seen that the TO_CHAR function in the first and fourth line obtains the system time respectively for china, American, Japanese, English
. From the result diagram, it can be seen that the time format under china and Japanese is 27-7 Month-2018
It can be seen that in the above problem, if you want to convert the time format into "DD-MON-YYYY", an ORA-01843 error will occur, because the system will not Identify English MON;
So the solution is as follows:
1. Change the time in select TO_DATE('01-FEB-1988', 'DD-MON-YYYY') from dual; Change the field to Chinese format, that is, "01-February-1998";
2. Set the format of its NLS_DATE_LANGUAGE to Aerican or English
ALTER SESSION SET nls_date_language = 'SIMPLIFIED CHINESE';
Recommendation: " mysql video tutorial》
The above is the detailed content of What should I do if ora01843 invalid month appears?. For more information, please follow other related articles on the PHP Chinese website!