Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: ConText CONTAINS in PL/SQL

Re: ConText CONTAINS in PL/SQL

From: <bonanos_at_yahoo.com>
Date: Tue, 19 Jan 1999 06:37:33 GMT
Message-ID: <78197d$8e0$1@nnrp1.dejanews.com>


Why don't you just use a two step query? I can't see why the original poster would prefer to use a one step.

In article <36A33E95.59A900C4_at_berlin.de>,   "Rüdiger J. Schulz" <r.schulz_at_berlin.de> wrote:
> u are right! the only way - in the moment - is to try the following way with
> dynamic-sql:
>
> CREATE OR REPLACE PROCEDURE yyy.ctxcheck
> (mSuch VARCHAR2)
> IS
> mxxxid NUMBER;
> xrows NUMBER;
> xcur NUMBER;
> xquery VARCHAR2(2000);
> BEGIN
> xcur := DBMS_SQL.OPEN_CURSOR;
> xquery := 'Select xxxid from yyy.data Where contains(volltext,
> '||chr(39)||mSuch||chr(39)||') > 0';
> DBMS_OUTPUT.PUT_LINE(xquery);
> DBMS_SQL.PARSE(xcur, xquery, DBMS_SQL.V7);
> DBMS_SQL.DEFINE_COLUMN(xcur,1,mxxxid);
> xrows := DBMS_SQL.EXECUTE(xcur);
> IF xrows > 0 THEN
> xrows := DBMS_SQL.FETCH_ROWS(xcur);
> DBMS_SQL.COLUMN_VALUE(xcur,1,mxxxid);
> ELSE
> mxxxid := 0;
> END IF;
> DBMS_OUTPUT.PUT_LINE( mxxxid );
> END;
> /
> show errors;
>
> Richard Murphy schrieb:
>
> > That does not work from within a PL/SQL block. For some reason PL/SQL does
> > not recognize the CONTAINS function. It works fine using SQL or embedded
> > SQL (ProC), but not from within a block - i get a CONTAINS not declared
> > error.
> >
> > Thanks though, R.
> >
> > "Rüdiger J. Schulz" wrote:
> >
> > > try the following sql-statement for a one-step-query:
> > >
> > > select test1, test2 from tablename where CONTAINS(test1,
> > > 'searchvalue') > 0;
> > >
> > > (here is test1 the column on which the context-policy runs)
> > >
> > > Richard Murphy schrieb:
> > >
> > > > Anyone know how to access the ConText CONTAINS function from within a
> > > > PL/SQL block? Most likely the only way is a two step query, but would
> > > > prefer a one step query.
> > > >
> > > > Thanks, R.
> > >
> > > --
> > > b e r l i n . d e - d e r o n l i n e d i e n s t d e r s t
> > > a d t
> > > ___________________________________________________________
> > > Primus-Online Berlin-Brandenburg GmbH & Co. KG
> > > debis Haus am Potsdamer Platz
> > > 10875 Berlin
> > >
> > > Rüdiger J. Schulz
> > > Technik
> > >
> > > tel: +49 (30) 2554-1497
> > > fax: +49 (30) 2554-3725
> > > email: r.schulz_at_berlin.de
> > > homepage: http://www.berlin.de
>
> --
> b e r l i n . d e - d e r o n l i n e d i e n s t d e r s t a d t
> ___________________________________________________________
> Primus-Online Berlin-Brandenburg GmbH & Co. KG
> debis Haus am Potsdamer Platz
> 10875 Berlin
>
> Rüdiger J. Schulz
> Technik
>
> tel: +49 (30) 2554-1497
> fax: +49 (30) 2554-3725
> email: r.schulz_at_berlin.de
> homepage: http://www.berlin.de
>
>

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue Jan 19 1999 - 00:37:33 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US