I have a table1(DueDate varchar2(20)). It has thousands of date data in different format with some bad data like characters.
eg.
YYYYMMDD,
MM/DD/YYY
This answer builds on Justin Cave’s. If you create another column that is a date field you can then do something like the following:
UPDATE table1 SET DueDate2 = my_to_date(DueDate)
WHERE DueDate2 IS NULL AND DueDate IS NOT NULL;
You could then re-run this update after each modification of the date format in the function. You would have to stop when all the dates not converted are invalid dates (such as ‘ABCD’).