I am using oracle data integrator as an ETL tool to load data, there is one column which as a source comes in format YYYYMMDD for ex: 20190418. I want to query that table to identify all those records which do not fit 20190418 or YYYYMMDD format. P.S. the column is in varchar2 datatype.
I already tried using something like this:
SELECT CASE WHEN NOT REGEXP_LIKE('20190418', '^\d{4}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])$') then '00000000' else '20190418' END FROM DUAL;
This seems to identify those illegal dates, but for example it didn't work for this one : '20181023'.
Can someone figure it out, I think I am missing some kind of pattern