File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date Conversion in SQL

 
Rao Raghu
Ranch Hand
Posts: 100
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jan Cumps
Bartender
Posts: 2576
11
C++ Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oracle specs expect an uppercase mask:
'YYYY-MM-DD HH24:MI:SS'

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

Regards, Jan
[ June 14, 2007: Message edited by: Jan Cumps ]
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic