Variable binding in spatial operator SDO_RELATE
398643Jul 17 2009 — edited Jul 17 2009Hi,
I am trying to do a variable binding for the operator SDO_RELATE, where I want to bind a variable point as second parameter.
The query without variable binding is:
SELECT l.* FROM bz_nw_loc l
WHERE SDO_RELATE(
l.coordinate,
SDO_GEOMETRY('POINT(679793.185623948 5151203.31847949)',82344),
'MASK=ANYINTERACT ') = 'TRUE';
the one with the binded variable pt is:
SQL> variable pt VARCHAR2(256);
SQL> exec :pt := 'SDO_GEOMETRY(''POINT(679793.185623948 5151203.31847949)'',82344)';
PL/SQL procedure successfully completed.
SQL> select l.* from bz_nw_loc l where SDO_RELATE(l.coordinate, :pt, 'MASK=ANYINTERACT ') = 'TRUE';
select l.* from bz_nw_loc l where SDO_RELATE(l.coordinate, :pt, 'MASK=ANYINTERACT ') = 'TRUE'
*
ERROR at line 1:
ORA-29900: operator binding does not exist
ORA-06553: PLS-306: wrong number or types of arguments in call to 'SDO_RELATE'
Did I do something wrong or is it not possible to bind a variable in this boolean expression in the left side?
thanks for your suggestions