Note that there are some explanatory texts on larger screens.

plurals
  1. POSpatial query w/o spatial data
    text
    copied!<p>I trying to execute a next query on Oracle Database 11g Enterprise Edition (11.1.0.6.0):</p> <pre><code>SELECT "__ItemId" FROM "Cities" WHERE "Longitude" IS NOT NULL AND "Latitude" IS NOT NULL AND SDO_ANYINTERACT(SDO_GEOMETRY('POINT(' || "Longitude" || ' ' || "Latitude" || ')'), SDO_UTIL.FROM_WKTGEOMETRY('POLYGON ((-100 80, 100 80, 100 -80, -100 -80, -100 80))')) = 'TRUE' </code></pre> <p>Where "Longitude" and "Latitude" - numeric [NUMBER(28,5)] columns in the "Cities" table.</p> <p><strong>UPD</strong>: Next query (with the same error) can be used for tests: </p> <pre><code>SELECT 'Solved!' FROM DUAL WHERE SDO_ANYINTERACT(SDO_GEOMETRY('POINT(' || 100 || ' ' || 100 || ')'), SDO_UTIL.FROM_WKTGEOMETRY('POLYGON ((-150.0 82.0, 150.0 82.0, 150.0 -67.0, -150.0 -67.0, -150.0 82.0))')) = 'TRUE'; </code></pre> <p>I get an error:</p> <pre><code>Error report - SQL Error: ORA-13226: interface not supported without a spatial index ORA-06512: at "MDSYS.MD", line 1723 ORA-06512: at "MDSYS.MDERR", line 8 ORA-06512: at "MDSYS.SDO_3GL", line 71 ORA-06512: at "MDSYS.SDO_3GL", line 239 13226. 00000 - "interface not supported without a spatial index" *Cause: The geometry table does not have a spatial index. *Action: Verify that the geometry table referenced in the spatial operator has a spatial index on it. </code></pre> <p>Questions:</p> <ol> <li>How can I check, that point with specified "Longitude" and "Latitude" in the specified polygon? Polygon in not always simple, it can be any.</li> <li>How can I create a spatial index on a table without any spatial column?</li> <li>It's really, I can not just call a spatial operator?</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload