Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sdo_within_distance fails

748220Feb 5 2010 — edited Feb 9 2010
Hello,

*after creating 2 tables [previous question|http://forums.oracle.com/forums/thread.jspa?threadID=1016196&tstart=30] and added the index, i tried to calculate the nearest distance to a station. Unfortunately, i receive the errorcode ora-13268. I looked the error up, but can't seem to find my error*

Can anyone tell me what i'm doing wrong?

Here is the code that i used to add the index on customers (stations table exact same, only different names):
-----
alter table CUSTOMERS add (geom sdo_geometry)
;
update CUSTOMERS set geom = sdo_geometry(2001, 28992, sdo_point_type(x, y, null), null, null)
;
INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID)
VALUES ('CUSTOMERS', 'GEOM',
MDSYS.SDO_DIM_ARRAY
(MDSYS.SDO_DIM_ELEMENT('X', 0.000000000, 400000.000000000, 0.500000000),
MDSYS.SDO_DIM_ELEMENT('Y', 300000.000000000, 700000.000000000, 0.500000000)
),28992)
;
CREATE INDEX XY_CUSTOMERS ON NEARNET.CUSTOMERS(GEOM)
INDEXTYPE IS MDSYS.SPATIAL_INDEX
PARAMETERS('sdo_indx_dims=2, layer_gtype=point');
-----

And this is the code to calculate the distance between both points
-----
SELECT
C.PC
,C.HUISNR
,C.HUISNR_TOEV
FROM
CUSTOMERS C
,STATIONS S
WHERE
C.PC = '7001AR'
AND SDO_WITHIN_DISTANCE(C.GEOM,S.GEOM,'DISTANCE=1000 UNIT=meter') = 'TRUE'
------

p.s. same error when using SDO_NN_DISTANCE
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 9 2010
Added on Feb 5 2010
4 comments
1,972 views