SDO_ANYINTERACT(geometry1, geometry2);


Checks if any geometries in a table have the ANYINTERACT topological relationship with a specified geometry. Equivalent to specifying the SDO_RELATE operator with 'mask=ANYINTERACT'.

See the section on the SDO_RELATE operator in this chapter for information about the operations performed by this operator and for usage requirements.

Keywords and Parameters

Value Description


Specifies a geometry column in a table. The column must be spatially indexed. Data type is SDO_GEOMETRY.


Specifies either a geometry from a table or a transient instance of a geometry. (Specified using a bind variable or SDO_GEOMETRY constructor.) Data type is SDO_GEOMETRY.


The expression SDO_ANYINTERACT(geometry1,geometry2) = 'TRUE' evaluates to TRUE for object pairs that have the ANYINTERACT topological relationship, and FALSE otherwise.

Usage Notes

See the Usage Notes for the SDO_RELATE operator in this chapter.

For an explanation of the topological relationships and the nine-intersection model used by Spatial and Graph, see Spatial Relationships and Filtering.

For information about 3D support with spatial operators (which operators do and do not consider all three dimensions in their computations), see Three-Dimensional Spatial Objects.


The following example finds geometries that have the ANYINTERACT relationship with a query window (here, a rectangle with lower-left, upper-right coordinates 4,6, 8,8). (The example uses the definitions and data described in Simple Example: Inserting_ Indexing_ and Querying Spatial Data and illustrated in Figure 2-1.)

SELECT c.mkt_id, c.name
  FROM cola_markets c
            SDO_GEOMETRY(2003, NULL, NULL,
              SDO_ORDINATE_ARRAY(4,6, 8,8))
            ) = 'TRUE';

    MKT_ID NAME       
---------- --------------------------------                             
         2 cola_b                                                               
         1 cola_a                                                               
         4 cola_d