0

I am trying to insert a date from C# into an Oracle DATE field.

Here is the format that I have currently..

to_date('2008/06/09', 'YYYY/MM/DD')

I have verified that my date is a valid date, and that it is in the format expected. The above throws the oracle error about a non-numeric character being found where a numeric character was expected.

Any suggestions?

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Bruce Pullum
  • 249
  • 1
  • 2
  • 13
  • 2
    Instead of converting string Date to `DateTime` or `Date` in Oracle, you should convert it to `DateTime` in C# code and then pass it as parameter with your Oracle command. – Habib Aug 19 '14 at 14:47
  • I will give that a shot.. I am already converting it to a C# date time and then using the to string format to make sure it is in the same format as my to_date function is expecting. If I understand what you are suggesting correctly, you are saying if I convert to a datetime in C# and use a paramater, I will not need to use the to_date, is tat correct? – Bruce Pullum Aug 19 '14 at 14:50
  • yes that is correct. – Habib Aug 19 '14 at 14:51

0 Answers0