Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2009
    Posts
    2

    Question Unanswered: Oracle-ADO-Date format problem

    We have a .NET application, that uses interfaces from a .NET business logic project, which makes the calls to database using ADO. Randomly an insert statement to a specific table fails with the error "ORA-01861: literal does NOT match format string".

    The unsuccessful insert statement is written in to a log and when running this very same insert straight to database via for example DbExpert, it is successfully run and committed. There are dates in these insert statements, which are handled with the TO_DATE -function with format DD-MM YYYY:HH24:MIS and the dates are correctly formatted in these statements. The method that does the insert is called hundreds of times in a day and approximately 1 insert per day fails.

    The same problem doesn't occur with SQL Server databases, so it seems to be some kind of an Oracle-ADO-date format problem? Any ideas would be highly appreciated!

  2. #2
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Is your TEXT string that contains the date always out to the second. If you have a date string that doesn't exactly match TO_DATE -function with format "DD-MM YYYY:HH24:MISS" it will fail
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  3. #3
    Join Date
    Oct 2009
    Posts
    2
    Yes, the string is always formatted the same way and as I said, the unsuccessful insert statement is written into a log and I can successfully run that very same statement straight into to the db. There's nothing wrong with the format.

  4. #4
    Join Date
    Aug 2009
    Location
    Olympia, WA
    Posts
    337
    Is there any commonality in times that will fail? Like always after midnight, just after noon or right on the hour? Can you post the last few that failed? And just to be clear, are you using Oracle's TO_DATE function or are you doing that somewhere in .net or ado?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •