Re: Oracle Spatial/Locator issue

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Thu, 29 Oct 2009 00:26:23 +0100
Message-ID: <4ae8d318$0$83235$e4fe514c_at_news.xs4all.nl>



Dan schreef:
> I'm learning Oracle Locator and I've created 2 tables that each have a
> field of type SDO_GEOMETRY that represents a lat/long value. I'm
> writing a query to join the tables and find the distance between the
> two points. I'm using the example in the Oracle Locator doc, so I
> know the syntax is correct. However, I keep getting ORA-13249 "SDO_NN
> cannot be evaluated without using index".
>
> I have created the index, created the metadata records for the 2
> fields in the 2 tables, yet I keep getting this error. Any ideas?
>
> Here is my query:
> select /*+ordered*/ a.eastern_point,b.southern_point, sdo_nn_distance
> (1) distance
> from eastmost_point a, southmost_point b
> where a.zip5=b.zip5 and a.zip4=b.zip4 and a.zip5='01001' and
> a.zip4='1101' and
> sdo_nn
> (a.eastern_point, b.southern_point, 'sdo_num_res=3', 1) = 'TRUE'
>
> Here is an example of an SDO_GEOMETRY value:
> (2001, 8307, (42.096136, -72.638013, ), , )
>
> Thanks,
> Dan

Did you put geo-indexes on both tables, and did you register them?

Shakespeare Received on Wed Oct 28 2009 - 18:26:23 CDT

Original text of this message