• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Oracle TO_DATE problem

 
Yash Sharma
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • 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 ]
 
Nagendra Prasad
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic