This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JDBC and the fly likes Date Conversion in SQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Databases » JDBC
Bookmark "Date Conversion in SQL" Watch "Date Conversion in SQL" New topic

Date Conversion in SQL

Rao Raghu
Ranch Hand

Joined: Jan 05, 2007
Posts: 100
I need to enter both date and time in a table in Oracle in a column which is of type 'Date'. In the 'update table' query, I use the following for conversion:

to_date('dateString','yyyy-mm-dd hh24:mi:ss');

But I am getting this error:

ERROR at line 1:
ORA-01830: date format picture ends before converting entire input string

I have googled for this query and found that it is perfectly alright.

The dateString will be a date viz. '2007-06-14 09:31:24.762'.

Any body has any inputs on this?

Thanks in Advance.

RAGHU<br /> <br />"When the going gets tough, the tough get going"
Jan Cumps

Joined: Dec 20, 2006
Posts: 2501

Oracle specs expect an uppercase mask:

and you have to drop the .762. It does not match your SS mask.

Regards, Jan
[ June 14, 2007: Message edited by: Jan Cumps ]

OCUP UML fundamental and ITIL foundation
youtube channel
GeeCON Prague 2014
subject: Date Conversion in SQL