Home » SQL & PL/SQL » SQL & PL/SQL » ORA-01843: not a valid month error
ORA-01843: not a valid month error [message #231041] Fri, 13 April 2007 14:07 Go to next message
san123
Messages: 1
Registered: April 2007
Junior Member
I am getting ORA-01843: not a valid month error, when I try to convert a text string to date...

In fact, I know that some of the characters in my data does not represent month, for eg: '2:' and I'd like to ignore these and get only data that has a valid format. Oracle doesn't allow me to ignore the wrong format and get just the right format data. Is there a way to either ignore or set the wrong format data to null?

thanks
Re: ORA-01843: not a valid month error [message #231048 is a reply to message #231041] Fri, 13 April 2007 15:07 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Write your own logic to validate the date before converting.
(Or)
Handle that in EXCEPTION block and do the needful.

By
Vamsi
Re: ORA-01843: not a valid month error [message #231050 is a reply to message #231041] Fri, 13 April 2007 15:19 Go to previous message
Littlefoot
Messages: 20897
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If you are on Oracle 10g R2, perhaps you might use error logging facility (search for DBMS_ERRLOG.CREATE_ERROR_LOG).
Previous Topic: UPDATE/ INSERT in merge
Next Topic: How can I create a column after a particular column
Goto Forum:
  


Current Time: Wed Dec 07 04:49:40 CST 2016

Total time taken to generate the page: 0.08948 seconds