Home » Server Options » Text & interMedia » Can't get the CONTAINS operator to work within PL/SQL functions
Can't get the CONTAINS operator to work within PL/SQL functions [message #76025] Mon, 03 March 2003 08:44 Go to next message
Sylvain
Messages: 3
Registered: December 2000
Junior Member
Hello,

Here a piece of code from a PL/SQL file:

--------------------
FUNCTION is_similar(
param1 IN VARCHAR2,
param2 IN VARCHAR2,
weight IN INTEGER)
RETURN BOOLEAN
IS
nombre INTEGER;
BEGIN
SELECT COUNT(*) INTO number FROM cars
WHERE brand=param1
AND CTXSYS.CONTAINS(brand, '?' || param2);
RETURN ( number > 0 );
END;
------------------------

I always get the same error:
10/7 PL/SQL: SQL Statement ignored
10/105 PL/SQL: ORA-00920: unrecognized relational operator

It deals with my query using the CONTAINS operator. I ended up wondering wether it is possible to use it from PL/SQL or not...
Can anyone help ??

Sylvain
Re: Can't get the CONTAINS operator to work within PL/SQL functions [message #76026 is a reply to message #76025] Mon, 03 March 2003 10:02 Go to previous message
prigano
Messages: 8
Registered: February 2003
Junior Member
Try

AND CTXSYS.CONTAINS(brand, '?' || param2) > 0;

CONTAINS is a function that returns a number (score) and you need to compare it to something. If you use > 0 then you get rows that matched you query in some manner. I haven't seen it used with other values (e.g., > 5) but you technically could.

hth,
pr
Previous Topic: Re: ORA 00020 urgent
Next Topic: ORACLE INTERMEDIA TEXT
Goto Forum:
  


Current Time: Thu Jul 31 03:03:56 CDT 2014

Total time taken to generate the page: 0.10347 seconds