472,353 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

ORA-01843: not a valid month

Hi,
I need to run a stored procedure which accepts date as an input. If I input date say 11252000 (MMDDYYYY), it is accepting but for dates such as 03062000, it is throwing error "ORA-01843: not a valid month". Please help me out. In the procedure, I am using to_date to convert the date into MMDDYYYY format, but its not working for all cases. Also if someone gives a date such as 0622000 (June 2nd 2000) or 5112000 (May 11th 2000), how to handle these? Any helping hand would be appreciated.



Thanks,
deep
Mar 3 '08 #1
4 23258
debasisdas
8,127 Expert 4TB
You need to convert the date to particular format before processing.
Mar 3 '08 #2
You need to convert the date to particular format before processing.
Can I decode the date based on its length...
Mar 3 '08 #3
amitpatel66
2,367 Expert 2GB
Hi,
I need to run a stored procedure which accepts date as an input. If I input date say 11252000 (MMDDYYYY), it is accepting but for dates such as 03062000, it is throwing error "ORA-01843: not a valid month". Please help me out. In the procedure, I am using to_date to convert the date into MMDDYYYY format, but its not working for all cases. Also if someone gives a date such as 0622000 (June 2nd 2000) or 5112000 (May 11th 2000), how to handle these? Any helping hand would be appreciated.



Thanks,
deep
Let me answer your second question first:


>>Also if someone gives a date such as 0622000 (June 2nd 2000) or 5112000 (May 11th 2000), how to handle these?

What you can do is, when the input value is passed to a procedure, then check it length, if the length is less than 8 then raise an application error "Invalid date entered. please enter in format MMDDYYYY"

For your first question, I would be interested to have a look at your source code(procedure) for better understanding. Could you please post your source code here?
Mar 3 '08 #4
Hi,
I need to run a stored procedure which accepts date as an input. If I input date say 11252000 (MMDDYYYY), it is accepting but for dates such as 03062000, it is throwing error "ORA-01843: not a valid month". Please help me out. In the procedure, I am using to_date to convert the date into MMDDYYYY format, but its not working for all cases. Also if someone gives a date such as 0622000 (June 2nd 2000) or 5112000 (May 11th 2000), how to handle these? Any helping hand would be appreciated.



Thanks,
deep
may be this helpful to

better you declare that date item as varchar2 while displaying convert it using To_char
function.
Mar 4 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Subrahmanyam Arya | last post by:
Dear oracle gurus, I am unable to get past the error ORA-12154: TNS: could not resolve service name on my host when using hsodbc to talk to a...
6
by: John | last post by:
Hi Right password -> ORA-12154: TNS:Could not resolve service name wrong password => ORA-01017: invalid username/password; logon denied ...
1
by: Park Yeon Jo | last post by:
About Error : ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect descriptor I installed Oracle 8.1.7 on Windows XP...
1
by: Adam Ruth | last post by:
I'm using OCI on Mac OS X and I've run into a strange problem with my TNSNAMES.ORA file. My TNSNAMES.ORA file has one entry INV4II and it works...
6
by: bdj | last post by:
Hello! I have at set of tnsnames.ora. I wich to make an union, e.g. a single file of it. How can I do that easy? Greetings Bjørn
4
by: Tig | last post by:
Hi all. I have a need to connect to an Oracle 7.3.3.5 database. I have a user who successfully connects to it with her Oracle 7.3 client. I...
2
by: mpatel6 | last post by:
I had this error in alert log and my instance was down, anybody can help me? Errors in file...
5
by: mivey4 | last post by:
Hi, First off, I am aware that this is a very heavily documented error and I have done my homework for throughly researching probable causes...
0
by: basmgokul | last post by:
I am using oracle 10g in windows vista.. when starting DB it throws an error Errors in file c:\database\udump\practice_ora_440.trc: ORA-00704:...
1
by: michael ngong | last post by:
michael.john@gmx.at (Michael John) wrote in message news:<90cc4edd.0306230900.28075193@posting.google.com>... MIchael I you stated the OS and...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.