469,328 Members | 1,266 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

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 23059
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

Post your reply

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

Similar topics

1 post views Thread by Adam Ruth | last post: by
6 posts views Thread by bdj | last post: by
reply views Thread by basmgokul | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by listenups61195 | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.