Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Yasin.

Asked: August 09, 2022 - 7:48 am UTC

Last updated: August 10, 2022 - 1:42 am UTC

Version: Oracle12c-PL/SQL 12.1.0

Viewed 1000+ times

You Asked

Hello,
I have a table that I want to update with spatial relationship.

My query is as follows;

UPDATE PARSEL P SET P.ILCE_ID= (SELECT G.OBJECTID FROM GEOILCELER G WHERE
SDO_RELATE(P.POLY, G.GEOM , 'mask=OVERLAPBDYINTERSECT')= 'TRUE' AND
(P.UPSERT_INSERT =1 OR P.UPSERT_UPDATE =1));

I am getting this error as a result of the query;

SQL Error [13226] [72000]: 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 88

I couldn't find the source and solution of the problem. What is your comment?
Thank you.

and Connor said...

You'll need a spatial index.

Check out this simple LiveSQL tutorial that walks through creating a spatial index on a table

https://livesql.oracle.com/apex/livesql/file/tutorial_IOURA5MQFAQAPZHVFTS087X5G.html

In your case, you will be doing a straight INSERT on USER_SDO_GEOM_METADATA.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

SQL

The Oracle documentation contains a complete SQL reference.