'Oracle: how to find the geo data that fails SDO_UTIL.TO_WKTGEOMETRY with error ORA-04063?

Our development server has some geographic data in a SDO_Geometry column. I believe some of the data is invalid because when I try to convert it to WKT format, I get the error:

: ORA-04063: package body "MDSYS.SDO_UTIL" has errors

How do I filter this table to get just values that will work fine with method MDSYS.SDO_UTIL.TO_WKTGEOMETRY?

The name of the column is GE_VET. I've tried to filter the table with methods like SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(cvg.GE_VET, 0.5) = 'TRUE' and cvg.GE_VET.ST_IsValid() = 1, but the error persists.

Maybe just a way to catch the exception calling TO_WKTGEOMETRY return null and go on with the other registers. Something that does not crashes all the query.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source