I have to perform some inserts into an Oracle DB. I have some dates
in the following format
'23.12.2011 13:01:001'
Following the documentation I wrote inserts to_date as follows:
to_date('23.12.2011 13:01:01', 'DD.MM.YYYY HH24:MI:SS')
which works properly. Now I have dates with milliseconds with the format
'23.12.2011 13:01:001'
I’ve tried the following:
to_date('23.12.2011 13:01:001', 'DD.MM.YYYY HH24:MI:SSFF3')
which is incorrect (delivers an error 01821. 00000 – "date format not recognized").
Which "String" should I use for this format with milliseconds?
An Oracle
DATEdoes not store times with more precision than a second. You cannot store millisecond precision data in aDATEcolumn.Your two options are to either truncate the string of the milliseconds before converting it into a
DATE, i.e.or to convert the string into a
TIMESTAMPthat does support millisecond precision