Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 

 
 

ORA-01840: input value not long enough for date format tips

Oracle Error Tips by Burleson Consulting (S. Karam)

 

The Oracle docs note this on the ora-01840 error:

ORA-01840 input value not long enough for date format
 
Cause: The data to be converted to date format was incomplete; the date format picture was longer than the input data.
 
Action: Either add more input or shorten the date picture format, then retry the operation.

On Oracle MOSC, ORA-01810 was being exemplified as being thrown, "When Creating a Window or Schedule with DBMS_SCHEDULER" while using Oracle Enterprise Edition - Version: 10.1.0.2 and can happen on any platform. 


Symptoms
You are attempting to create a window or a schedule using the package DBMS_SCHEDULER, such as in the following example:

begin
dbms_scheduler.create_schedule (
schedule_name => 'nightly_schedule',
start_date => '01-JAN-2004 01:00:00',
end_date => '01-JAN-2005 01:00:00',
repeat_interval => 'FREQ=DAILY; INTERVAL=1',
comments => 'Important Comments Here');
end;
/


However, it fails with the following stack:

ORA-01840: input value not long enough for date format
ORA-06512: at line 2

You check the NLS_DATE_FORMAT, and it is, indeed, set to DD-MON-YYYY HH24:MI:SS.
Cause
DBMS_SCHEDULER requires the hours in a 12 hour, AM/PM model.
Fix
Change the code to use a 12 hour format instead of 24 hour. This does not require a change in the NLS_DATE_FORMAT:

begin
dbms_scheduler.create_schedule (
schedule_name => 'nightly_schedule',
start_date => '01-JAN-2004 01:00:00AM', <--- Note the 'AM' Here
end_date => '01-JAN-2005 01:00:00AM', <-- Note the 'AM' Here
repeat_interval => 'FREQ=DAILY; INTERVAL=1',
comments => 'Important Comments Here');
end;
/


It is important to note that MOSC finishes this information with this statement: "This is true for all date strings passed to dbms_scheduler for create schedule, window, or job. Even if your date format is, say, DD-MON-RR, you still need to use the format above." 
 


 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright ? 1996 -  2014

All rights reserved by Burleson

Oracle ? is the registered trademark of Oracle Corporation.


 

��  
 
 

 
 
 
 
oracle dba poster
 

 
 
Oracle performance tuning software 
 
Oracle Linux poster