PLS-306: wrong number or types of arguments in call to 'SDO_NN'

232 Views Asked by At

I'm trying to SDO_NN or Oracle SQL Developer. I've run the query on one server and it worked fine. I then copied it to a different server and changed just the table names since the second server has the same tables but slightly different names, the columns are the same but in the new server it is throwing an error.

Apart from changing the table names everything else is the same in the query. The only thing I can thing of is different versions of Oracle on the two servers. It is working on a server running Oracle 19c EE but failing on the server running 11g EE.

Query:

select WBAN,
       STATION_NAME,
       EXCH_NAME,
       sdo_nn_distance (1) distance_in_km,
       GEOM_LAT_LON
FROM   SCHEMA.WEATHER_DATA,
       SCHEMA.EXCH_GEOM 
WHERE  SDO_NN(WEATHER_DATA.GEOM_LAT_LON, EXCH_GEOM.GEOM, 'sdo_num_res=1 distance=40 unit=kilometer') ='TRUE'
ORDER BY EXCH_NAME

Error:

ORA-29900: operator binding does not exist
ORA-06553: PLS-306: wrong number or types of arguments in call to 'SDO_NN'
29900. 00000 -  "operator binding does not exist"
*Cause:    There is no binding for the current usage of the operator.
*Action:   Change the operator arguments to match any of the existing
           bindings or add a new binding to the operator.
Error at Line: 221 Column: 7

I'm trying a spatial query to identify the nearest entry in the EXCH_GEOM table to the WEATHER_DATA table within 40km.

0

There are 0 best solutions below