Oracle Spatial/Locator issue

From: Dan <daniel.ostertag_at_visaer.com>
Date: Wed, 28 Oct 2009 14:39:39 -0700 (PDT)
Message-ID: <a89245fc-5351-44a7-989f-bf758b63ed98_at_k17g2000yqb.googlegroups.com>



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 Received on Wed Oct 28 2009 - 16:39:39 CDT

Original text of this message