Re: [Q]: CONTEXT one-step query in PL/SQL procedure

From: Fat Boy Slim <fatty_at_boy.slim.com>
Date: 1998/02/19
Message-ID: <887903241.22918.0.nnrp-08.9e98628b_at_news.demon.co.uk>#1/1


[Quoted] Thanks Keith.

The problem I now have is that in order to use ctx.contains I need a intermediate results table. Now, I will be having several concurrent users on this system and they will al be attached as the same user name (as this is being executed from Oracle Web Agent).

So, for my next question, how can I create an intermediate results table that is individual to the specific session, which to complicate things further will be setup and destroyed each time I serve up a web page containing 10 rows from the result set? (ie the end user wants to page through the result set, 10 at a time, and OWA starts a fresh session each time a call is made to it).

[Quoted] Quentin North

Keith E. Moore wrote in message ...
>On Thu, 19 Feb 1998 11:41:04 -0000, Fat Boy Slim <fatty_at_boy.slim.com>
 wrote:
>>Hi
>>
>>Im trying to do the following CONTEXT query within PL/SQL. THis query
 works
>>one hundred per cent using SQL*Plus, but will not compile when placed in
>>PL/SQL. Anyone know why?
>>
>> select * from course where
>> contains(content,s,1)>0 or
>> contains(title,s,2)>0 and
>> trainingunit = deptid
>> order by score(2) desc, score(1) desc, title;
>>
>>When this is placed in a PL/SQL procedure, I get an undeclared identifier
>>"CONTAINS" message on compile. In SQL Plus or SQL Worksheet, this works
>>fine.
>>
>>
> contains is a "magic" word, it indicates to the parser to re-write the
 SQL to
>use the Context Keys. in PL/SQL it doesn't get detected, therefore you
 need
>to use the ctx_contains procedure. The worst one is that THIS doesn't work
>for the same reason:
>
> INSERT INTO table
> SELECT col1, col2 FROM table2 WHERE contains(title,s,2)>0;
>
>BTW, having multiple single step context queries is generally alot slower
>(orders of magnitude) than two two step queries. If your tables only have
 100s
>or thousands of rows it probably doesn't matter.
>
>
>--
>-- Keith Moore
> President
> KMA Computer Solutions, Inc.
>
>--
>/*----C/C++--Java--VB--Pro*C--SQL--OCI--Java--Delphi--ODBC--COBOL-----*
> * When the project must be saved at all costs: *
> * KMA Computer Solutions, Inc. Project Troubleshooting/Recovery *
> *---------Linux---AIX---HPUX---SYSV---Novell---NT---OS/2---'95-------*/
>
Received on Thu Feb 19 1998 - 00:00:00 CET

Original text of this message