SDO_NN error [message #442449] |
Mon, 08 February 2010 02:58 |
robin o
Messages: 2 Registered: February 2010
|
Junior Member |
|
|
Hello all,
i've got a strange problem when executing a query. When running the whole query everything works fine, but when i comment the line AND C.PC LIKE '7001AR', it returns the error:
ORA-13249: SDO_NN cannot be evaluated without using index
ORA-06512: in "MDSYS.MD", regel 1723
ORA-06512: in "MDSYS.MDERR", regel 17
ORA-06512: in "MDSYS.PRVT_IDX", regel 9
This is de SQL Statement:SELECT /*+ INDEX(c XY_CUSTOMERS)*/
C.PC
,C.HUISNR
,C.HUISNR_TOEV
,SDO_NN_DISTANCE(1)
FROM
CUSTOMERS C
,STATIONS S
WHERE
SDO_NN(S.GEOM,C.GEOM,'DISTANCE=10000 UNIT=meter',1) = 'TRUE'
--AND C.PC LIKE '7001AR'
Any idea what I'm doing wrong??? I've got a spatial index on both tables.
|
|
|
Re: SDO_NN error [message #442593 is a reply to message #442449] |
Tue, 09 February 2010 05:30 |
robin o
Messages: 2 Registered: February 2010
|
Junior Member |
|
|
Hello all,
i've found the solution by adding optimizer hints:
/*+ LEADING(c) USE_NL(c s) INDEX(s spatial_index)*/
Thank you for your time.
|
|
|