aspose file tools*
The moose likes JDBC and the fly likes java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string" Watch "java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string" New topic
Author

java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 732
Hello,

Here is oracle SQL prompt that ran this query fine:


But in my code its throwing the following error:


Her is my code:



Best regards
Sudheer Bhat
Ranch Hand

Joined: Feb 22, 2011
Posts: 75
Can you print the value of date variable? The error message clearly says that input string is larger than the provided date format.
You need to make sure that your string should contain exactly 5 characters. For eg 08:00.
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 732
The date is 7/30/2011 and has time 14:45
Sudheer Bhat
Ranch Hand

Joined: Feb 22, 2011
Posts: 75
You need to strip off the 7/30/2011 part in your date variable and the to_date function should only get 14:45.
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 732
You need to strip off the 7/30/2011 part in your date variable and the to_date function should only get 14:45.

How?
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2495
    
    8

You could use java.lang.String.substring(int, int)


OCUP UML fundamental and ITIL foundation
youtube channel
 
jQuery in Action, 2nd edition
 
subject: java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string