Oracle Text Application Developer's Guide Release 9.0.1 Part Number A90122-01 |
|
CONTEXT Query Application, 3 of 4
This application is based on PL/SQL server pages. Figure A-1 illustrates how the browser calls the PSP stored procedure on Oracle9i via a web server.
This application has the following requirements:
This section describes how to build the web application.
You must create a text table to store your html files. This example creates a table called search_table
as follows:
create table search_table (tk numeric primary key, title varchar2(2000), text clob);
You must load the text table with the HTML files. This example uses the control file loader.ctl to load the files named in loader.dat. The SQL*Loader command is as follows:
% sqlldr userid=scott/tiger control=loader.ctl
Index the HTML files by creating a CONTEXT index on the text column as follows. Since we are indexing HTML, this example uses the NULL_FILTER preference type for no filtering and uses the HTML_SECTION_GROUP type:
create index idx_search_table on search_table(text) indextype is ctxsys.context parameters ('filter ctxsys.null_filter section group CTXSYS.HTML_SECTION_GROUP');
The application must present selected documents to the user. To do so, Oracle must read the documents from the CLOB in search_table
and output the result for viewing, This is done by calling procedures in the search_htmlservices package. The file search_htmlservices.sql must be compiled. You can do this at the SQL*Plus prompt:
SQL> @search_htmlservices.sql Package created.
The search page is invoked by calling search_html.psp from a browser. You compile search_html in Oracle9i with the loadpsp command-line program:
% loadpsp -replace -user scott/tiger search_html.psp "search_html.psp": procedure "search_html" created.
See Also:
Oracle9i Application Developer's Guide - Fundamentals for more information about using PSP. |
You must configure your web server to accept client PSP requests as a URL. Your web server forwards these requests to the Oracle9i server and returns server output to the browser. Refer to Figure A-1.
You can use the Oracle WebDB 2.x web listener or Oracle iAS which includes the Apache web server. See your web server documentation for more information.
You can access the query application from a browser using a URL. You configure the URL with your web server. An example URL might look like:
http://mymachine:7777/mypath/search_html
The application displays a query entry box in your browser and returns the query results as a list of HTML links. See Figure A-2, "Screen shot of Web Query Application".
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|