This discussion is archived
1 Reply Latest reply: Jan 10, 2013 8:34 PM by damorgan RSS

Problem with spatial SQL

447702 Newbie
Currently Being Moderated
Hi All

I am facing the below error with the spatial SQL using SDO_NN. The SQL works fine without SDO_NN function. I have all the spatial indexes and data populated in the metadata table. Please help

select t.asset_id, t.s_asset_id ,
sdo_nn_distance (1)
from (
SELECT TAB.ASSET_ID asset_id,
s.ASSET_ID s_asset_id, tab.geom t_geom, s.geom s_geom, tab.feature_geom fea_geom
FROM
(SELECT C.ASSET_ID,f.geom feature_geom ,
SDO_GEOM.SDO_BUFFER(F.GEOM, M.DIMINFO, 5) "GEOM"
FROM SUPPORT_STRUCTURE C,
USER_SDO_GEOM_METADATA M,
FEATURE F
WHERE M.TABLE_NAME = 'FEATURE'
AND M.COLUMN_NAME = 'GEOM'
AND C.ASSET_ID = 921505
AND C.ASSET_ID = F.ASSET_ID
-- AND C.OWNER_SECTION_ID IS NULL
) TAB ,
SPANGUY s
WHERE SDO_GEOM.SDO_INTERSECTION(TAB.GEOM, S.GEOM, 0.005) IS NOT NULL ) t
where SDO_NN( t.fea_geom, t.s_geom, 'sdo_num_res=5', 1) = 'TRUE';


Error
----------------
ORA-13249: SDO_NN cannot be evaluated without using index
ORA-06512: at "MDSYS.MD", line 1723
ORA-06512: at "MDSYS.MDERR", line 17
ORA-06512: at "MDSYS.PRVT_IDX", line 9
13249. 00000 - "%s"
*Cause:    An internal error was encountered in the extensible spatial index
component. The text of the message is obtained from some
other server component.
*Action:   Contact Oracle Support Services with the exact error text.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points