O'Reilly logo

Applying and Extending Oracle Spatial by Siva Ravada, Simon Gerard Greener

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding the IS OF TYPE comparison operator

The Oracle IS OF TYPE comparison operator (IS NULL) allows for the type of an object to be examined. The following example demonstrates its use:

Select Case When Then End MDSYS.ST_Point.FROM_WKT('POINT(6012578.005 2116495.361)', 2872) is of type (MDSYS.ST_Point) then 'POINT' Else 'GEOMETRY' end as ofTypePoint, case when MDSYS.ST_Point.FROM_WKT('POINT(6012578.005 2116495.361)', 2872) is of type (MDSYS.ST_Geometry) then 'GEOM' Else 'Something Else' end as ofTypeGeom, case when MDSYS.ST_Point.FROM_WKT('POINT(6012578.005 2116495.361)', 2872) is of type (ONLY MDSYS.ST_Geometry) then 'GEOM' Else 'Something Else' end as ofTypeOnlyGeom From dual; -- Results -- OFTYPEPOINT OFTYPEGEOM OFTYPEONLYGEOM ----------- ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required