Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 491
  • Last Modified:

Error inserting date with time

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
graywolf1988
Asked:
graywolf1988
  • 2
1 Solution
 
jammalkCommented:
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
 
jammalkCommented:
Sorry. The usual default date format is DD-MON-YYYY & also it depends on the database settings too.
0
 
ddaCommented:
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now