-- Allow output from dbms_output.put_line from PL/SQL 
--   and System.out.println() from Java

set serveroutput on
call dbms_java.set_output(2000);

column text format a60

variable srch varchar2(2000);

-- Note we'll put the search string into a bind variable first, then use
-- that bind variable in the query. Using the function directly in the query
-- will disable proper use of the interMedia Text index.
-- How a bind variable is used will depend on your programming language - we
-- are using a SQL*Plus variable here.

exec :srch := JAvTranslate ('+cat dog rabbit fox -fish')

exec dbms_output.put_line ('Translated query is: '||:srch)

select score(0), text from avtest where contains
(text, :srch, 0)>0
order by score(0) desc;

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy