Tests if the ST_Curve value is a ring. A curve is a ring if it is closed and simple (no self intersections).
SELECT * FROM SpatialShapes WHERE IF Shape IS OF ( ST_Curve ) AND TREAT( Shape AS ST_Curve ).ST_IsRing() = 1 THEN 1 ENDIF = 1
The following returns all rows in curve_table that have geometries that are rings. This example assumes the geometry column has type ST_Curve, ST_LineString, ST_CircularString or ST_CompoundCurve.
SELECT * FROM curve_table WHERE geometry.ST_IsRing() = 1
SQL/MM (ISO/IEC 13249-3: 2006) 7.1.6