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!

Variable binding in spatial operator SDO_RELATE

398643Jul 17 2009 — edited Jul 17 2009
Hi,

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
This post has been answered by Luc Van Linden on Jul 17 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 14 2009
Added on Jul 17 2009
2 comments
2,420 views