It so happened that I should get the date from the varchar2 column in oracle, but it is incompatible in formatting. Some fields may have "2009.12.31", others - 2009/12/32 00:00:00. Is there any standard design I could use, so I don't have to go through
begin to_date(date, mask1) exception begin to_date(date,mask2) exception .. end end
blocks or string analysis of a preceding date to determine the correct mask? Something like to_date(date, mask1,mask2,..)?
to_date(date, mask1,mask2,..)
No, but some Oracle date formats are forgiving differences, for example.
SQL> select to_date('2009.12.31','YYYY/MM/DD') from dual; TO_DATE('20 ----------- 31-DEC-2009
, , . , , , .
, , - , (, "10-11-2009" 10 11 ?), .
, , (, "DD-MON-YYYY HH24: MI: SS" "31 -DEC-2009" 10:30:00 ', '31/deC/2009 10:30', '31 dec 2009 ').
BEGIN (format1) , , (format2) , , ....
Source: https://habr.com/ru/post/1726058/More articles:What exception should a .NET program throw if it encounters invalid data? - .netCreating a javascript object to emulate a class and static methods? - javascriptHow to drown out an abstract collection using Moq? - c #C # .net - authentication expiring prematurely - authenticationSmart algorithm for finding times when the sum of digits is equal to the number of segments in digital dispatching - language-agnosticHow to replace node name with another in Xslt? - xmlC # Convert byte array to string using preamble or standard encoding - c #Google Calendar java api - javaHow to configure Zend_Form to use array notation? - phpA similar but not the same string sequence - javaAll Articles