Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

date not fitting NLS_DATE_FORMAT

741904Feb 21 2010 — edited Feb 21 2010
Hello to all,

I'm encountering a little trouble when attempting to insert a date not fitting the NLS_DATE_FORMAT and trying to 'force' it by the means of formating params into the INSERT request.

I want to insert a date I receive like '04-06-15' into a DATE field in spite of the 'nls_date_format' like 'DD-MON-RR'.

Is it possible to transform the '04-06-15' to fit the nls format in place of modifying the nls format?

Thanks for any help.
Claude

I tried the followings
------------------------------->
INSERT INTO VOLSCONTROLE VALUES ('', '','04-06-15')
*
ERROR at line 1:
ORA-01843: not a valid month
------------------------------
INSERT INTO VOLSCONTROLE VALUES ('', '',TO_DATE('04-06-15','DD-
MON-RR'))
*
ERROR at line 1:
ORA-01843: not a valid month
----------------------------
INSERT INTO VOLSCONTROLE VALUES ('PL-1', 'A320',TO_DATE('04-06-15'))
*
ERROR at line 1:
ORA-01843: not a valid month
<--------------------------------------------------------


2- My TABLE/CONTEXT/NLS_DATE_FORMAT:

TABLE volscontrole
Name Null? Type
------------------ -------- -------------
BREVET VARCHAR2(10)
TYPEAV VARCHAR2(10)
VALIDITE DATE
***********************
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
**********************
SYS_CONTEXT('USERENV','NLS_DATE_FORMAT')-> DD-MON-RR
**********************
This post has been answered by ttt on Feb 21 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 21 2010
Added on Feb 21 2010
3 comments
762 views