Home » SQL & PL/SQL » SQL & PL/SQL » ORA-01843: not a valid month -Error
ORA-01843: not a valid month -Error [message #197745] Thu, 12 October 2006 09:02 Go to next message
bhoite_amol83
Messages: 110
Registered: June 2005
Location: Pune
Senior Member
Hi all,
I have a problem while calling a procedure. But facing some problems while executing.

/**********************************************/
CREATE OR REPLACE PROCEDURE FIELDVALIDATE.SP_FVP_DATES_AND_TIMES (
SMALLEST_DATE IN DATE , SMALLEST_TIME IN DATE , LARGEST_DATE IN DATE , LARGEST_TIME IN DATE
)
AS
BEGIN
IF ( TRUNC(SMALLEST_DATE) + ( SMALLEST_TIME - TRUNC(SMALLEST_TIME)) ) > ( TRUNC(LARGEST_DATE) + ( LARGEST_TIME - TRUNC(LARGEST_TIME)) ) THEN
RAISE_APPLICATION_ERROR(-20001 , 'IN PROCEDURE');
END IF;
END;
/
/**************************************************/

after executing

EXEC FIELDVALIDATE.SP_FVP_DATES_AND_TIMES('01/01/2006','05:00','01/01/2006','01:00' )

Gives error message.

ORA-01843: not a valid month
ORA-06512: at line 1

/*****************************************************/

Please tell me the reason of it.


Thanks in advance for any kind of help.

Amol.

Re: ORA-01843: not a valid month -Error [message #197749 is a reply to message #197745] Thu, 12 October 2006 09:23 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
repeat after me:
'01/01/2006' is NOT a date
'05:00' is NOT a date
'01/01/2006'is NOT a date
'01:00' is NOT a date.

After 20 repetitions look again at your code. If you still cannot find the error, come back and we will help you.
Re: ORA-01843: not a valid month -Error [message #197884 is a reply to message #197749] Fri, 13 October 2006 01:50 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Or possibly:

repeat after me:
'01/01/2006' is NOT a date
'05:00' is NEVER EVER a date
'01/01/2006'is NOT a date
'01:00' is NEVER EVER a date.


Previous Topic: I have a table contining 20 million records.
Next Topic: How to delete
Goto Forum:
  


Current Time: Tue Dec 06 06:25:08 CST 2016

Total time taken to generate the page: 0.07484 seconds