SDO_RELATE [message #561712] |
Tue, 24 July 2012 23:00 |
|
orasql2010
Messages: 3 Registered: April 2012
|
Junior Member |
|
|
Hi,
I am new to Oracle Spatial,
Trying to pull out some data from 2 tables using SDO_RELATE...Any suggestions
SELECT P.PROPNUM AS PROP_NUM,
PI.PROP_CODE AS PROP_CODE,
FROM AB.PROPERTY_POLY P,
INNER JOIN AB.PLANS PI ON SDO_RELATE(PI.GEOMETRY, P.GEOMETRY,'mask=contains+inside+covers+overlapbdyintersect+equal+on+coveredby')='true';
Errors:
ORA-00604: error occurred at recursive SQL level 1
ORA-13207: incorrect use of the [SDO_RELATE] operator
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 500
ORA-06512: at line 4
00604. 00000 - "error occurred at recursive SQL level %s"
*Cause: An error occurred while processing a recursive SQL statement
(a statement applying to internal dictionary tables).
*Action: If the situation described in the next error on the stack
can be corrected, do so; otherwise contact Oracle Support.
Error at Line: 6 Column:
|
|
|
|
Re: SDO_RELATE [message #561740 is a reply to message #561716] |
Wed, 25 July 2012 01:48 |
_jum
Messages: 577 Registered: February 2008
|
Senior Member |
|
|
It seems, that You can't use sdo_relate as JOIN condition.
With the table from ORACLE documentation you could use the spatial operator sdo_relate:
SELECT m1.mkt_id m1,
m2.mkt_id m2,
sdo_relate(m1.shape, m2.shape, 'mask=contains+inside+covers+overlapbdyintersect+equal+on+coveredby') rela
FROM cola_markets m1
INNER JOIN cola_markets m2
ON (m1.mkt_id<>m2.mkt_id)
WHERE sdo_relate(m1.shape, m2.shape, 'mask=contains+inside+covers+overlapbdyintersect+equal+on+coveredby+touch')='TRUE';
m1 m2 rela
---------------------------
2 1 FALSE
3 1 TRUE
1 2 FALSE
3 2 TRUE
2 3 TRUE
1 3 TRUE
|
|
|
|