• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Oracle TO_DATE problem

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an insert statement resembling the one that follows which is run again and again inside a loop. Problem is when I try to run this insert through a standalone java application the system would just hang at executeUpdate() method with nothing happening.
INSERT INTO TBL_AIRLINE_TIME (Airline_id, Flight_no, From_City_Code, From_Time, To_City_Code, To_Time, Day_Of_Week) VALUES ('9W', '322', 'AHM', TO_DATE('7:20','HH24 MI'), 'CHN', TO_DATE('10:45', 'HH24 MI'), '1,2,3,4,5,6,7')
When I replace the TO_DATE strings with static data (for test purpose) the insert works. I presume no problem with the database since I am able o do insert/query other and this table in the database without problem.
Is there any known issue with using TO_DATE()? Can any one please suggest a workaround (though I must insert only time in hours:minutes the field is a Date/time field).
Thanks for your time.
[ November 05, 2003: Message edited by: Yash Sharma ]
 
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just wondering..
should the format mask be HH24:MI???
 
Yash Sharma
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The formatting mask seems OK because the same query runs fine using SQLPlus or any client such as Toad that I use here. An update that I wish to post is that this hanging problem occurs perhaps not due to the TO_DATE function but when I explicitly specify te column names in my Insert statement.
For ex: INSERT INTO TABLE_NAME VALUES('ID',100) works fine using the java class while the same statement if written like INSERT INTO TABLE_NAME (ID, VAL) VALUES('ID',100) hangs the system when executeUpdate() is summoned.
Again, I must state that all statements run fine using any Oracle client. problem is only while doing it using JDBC.
 
You will always be treated with dignity. Now, strip naked, get on the probulator and hold this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic