Solved

Error inserting date with time

Posted on 2001-06-08
3
481 Views
Last Modified: 2008-03-17
I am getting error
ORA-1830 date format picture ends before converting entire input string

while trying to insert:

insert into ABC
(ABCDate)
values('03-JUN-1996 12:25:19 AM');

Isn't it a correct datetime format ?
It works if I use TO_DATE, but do I have to?
0
Comment
Question by:graywolf1988
  • 2
3 Comments
 
LVL 2

Expert Comment

by:jammalk
ID: 6169042
Yes, you have to use the TO_DATE function to let the Oracle know what format you are presenting the date in, if it is other than the default, MM-DD-YYYY.
0
 
LVL 2

Expert Comment

by:jammalk
ID: 6169065
Sorry. The usual default date format is DD-MON-YYYY & also it depends on the database settings too.
0
 
LVL 4

Accepted Solution

by:
dda earned 100 total points
ID: 6169227
You can do "alter session set nls_date_format='DD-MON-YYYY HH12:MI:SS AM" before your insert statements, and this will allow you to use your date formatr without to_date().
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that useā€¦
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to recover a database from a user managed backup

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now