JOINs and CATSEARCH
833964Jan 25 2011 — edited Jan 27 2011I have 3 tables
CONTRACTOR
- ID
- NAME
- ADDRESS
CONTRACTOR_DOMESTIC_CODE
- ID
- CODE
CONTRACTOR_INTERNATIONAL_CODE
- ID
- CODE
The codes consist of multiple word and there is a UI where a user can enter any one word and search. I need to create a CTXCAT index over the codes to return the results. The user has an option of selecting Domestic, International, Both while performing his search.
For domestic search I tried the following query:
SELECT con.id
FROM contractor con
LEFT OUTER JOIN contractor_domestic_code dom
ON con.id = dom.id
WHERE con.status_delete != 'Y'
AND CATSEARCH(dom.code, 'de*', '') > 0
It throws the following exception
ORA-20000: Oracle Text error:
DRG-10849: catsearch does not support functional invocation
DRG-10599: column is not indexed
20000. 00000 - "%s"
*Cause: The stored procedure 'raise_application_error'
was called which causes this error to be generated.
*Action: Correct the problem as described in the error message or contact
the application administrator or DBA for more information.
I haven't been able to get around this problem. IN clause works but is very slow. I will also need to add contractor_international_code in the query when required.