ORA-01843: not a valid month

Source: Internet
Author: User

ORA-01843:

Not a valid month

Cause:

A date specified an valid month.

Valid month are: January-December, for format code MONTH, and Jan-Dec, for format code MON.

Action:

Enter a valid month value in the correct format.

Scenario One

The Oracle 10g on the server uses the Chinese character set, so you will be prompted when inserting according to the following date formatORA-01843.

SQL> Insert into auction values (4, 'canonical', 1,250, '27-oct-2002 ');
Insert into auction values (4, 'cannon cama', 1,250, '27-oct-2002 ')
ORA-01843: not a valid month

To solve this problem, you can modifyNLS_DATE_LANGUAGEAndNLS_DATE_FORMAT, The method is as follows:

SQL> alter session set nls_date_language = AMERICAN;
Session altered

SQL> alter session set nls_date_format = 'dd-MON-YYYY ';
Session altered

Test the preceding insert statement again.

SQL> Insert into auction values (4, 'canonical', 1,250, '27-oct-2002 ');
1 row inserted

Note:

Because only the current session'sNLS_DATE_LANGUAGEAndNLS_DATE_FORMATSo useShow parametersThe two parameter settings are not changed.

SQL> show parameters NLS_DATE_LANGUAGE
NAME TYPE VALUE
-------------------------------------------------------------------
Nls_date_language string

SQL> show parameters NLS_DATE_FORMAT
NAME TYPE VALUE
-------------------------------------------------------------------
Nls_date_format string

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.