I have got a date coming from the webservice in 9999-06-15T00:00:00.000+0000 format. How do i save this into the date column of a table in Oracle 12c DB.
I have tried
select to_date('9999-06-15T00:00:00.000+0000', 'YYYY-MM-DDTHH24:MI:SS.fff+0000')
from dual;
but i get an error "ORA-01821:date format not recognized"
Any help is much appreciated
The literal's format comforms to
timestampdata type instead ofdatedata type. So, usingto_timestampconversion would suffice if it had a format without the trailing portion starting from plus sign asquoting letter
Tas"T", and suffixing with.FF3instead offffas in your original format mask. Having that trailing part we need a conversionWITH TIME ZONE(TO_TIMESTAMP_TZ) which hasTZH(Time Zone Hour) andTZM(Time Zone Minute) portions after plus sign. So, useconforming to your data model.
Demo