UPDATE:
I do not find published links to this type of DATE corruption on the Oracle support site. (Maybe my quick searches just didn't open it.)
- Baddate Script Check database for corrupt dates [ID 95402.1]
- Error 2790435 - Serial INSERT with parallel SELECT conversion and type conversion can insert corrupted data [ID 2790435.8]
The result of the DUMP () function shows that the date value is indeed incorrect:
Typ=12 Len=7: 120,110,11,18,13,0,16
We expect that the minute byte should be a value from one to sixty, and not from zero.
7 bytes of DATE represent a century (+100), year (+100), month, day, hour (+1), minutes (+1), seconds (+1).
The only time I saw invalid DATE values ββlike this one was when a DATE value was provided as a bind variable from the Pro * C program (where the bind value is provided in an internal representation of 7 bytes, completely bypassing normal validation procedures that catch invalid dates, for example February 30)
There is no reason to expect the behavior you see, given the syntax of Oracle that you posted.
This is either a false anomaly (memory corruption?), Or if it is repeatable, then this is an error (error) in the Oracle code. If this is a flaw in Oracle code, the most likely suspect will be the "new" features in the non-partisan release.
(I know that CAST is a standard SQL function that has been used in other databases for centuries. Iβm probably an old school and I never entered it into my repertoire of Oracle syntax. I donβt know which version of Oracle it introduced CAST, but I would stay with him in the first issue in which he appeared.)
Big "red flag" (as another comment noted): CAST( datecol AS DATE) .
You would expect the optimizer to consider this as equivalent to date_col ... but past experience shows us that TO_NUMBER( number_col ) actually interpreted by the optimizer as TO_NUMBER( TO_CHAR ( number_col ) ) .
I suspect something like this might happen to this unnecessary CAST.
Based on the one record you showed, I suspect that the problem is with values ββwith a value of "59" for minutes or seconds and possibly a value of "23" for several hours, errors will be displayed.
I would try checking places where minutes, hours or seconds are stored as 0:
SELECT id, DUMP(activitydate) FROM newtable WHERE DUMP(activitydate) LIKE '%,0,%' OR DUMP(activitydate) LIKE '%,0'