Index   Search   Add FAQ   Ask Question  
 

Please note: This page is not maintained anymore. Please visit the new and improved page at http://www.orafaq.com/wiki/Mod_plsql_FAQ

Oracle MOD_PLSQL FAQ

$Date: 29-Aug-2003 $
$Revision: 1.01 $
$Author: Frank Naudé $

The tangled webs we're weaving

Topics

  • What is MOD_PLSQL and what can one use it for?
  • How does one start and stop MOD_PLSQL?
  • How does one configure MOD_PLSQL?
  • How does one program using MOD_PLSQL?
  • How does one use HTTP COOKIEs?
  • Can a Web page be refreshed/reloaded after a given interval?
  • Where can one get more info about MOD_PLSQL?

  • Back to Oracle FAQ Index

    What is MOD_PLSQL and what can one use it for?

    MOD_PLSQL is an Apache (Web Server) extension module that allows one to create dynamic web pages from PL/SQL packages and stored procedures. It is ideal for developing fast and flexible applications that can run on the Internet or an Intranet. MOD_PLSQL was formerly called the Oracle PL/SQL Cartridge and OWA (Oracle Web Agent).

    For more information about the Apache server, see the Oracle HTTP Server FAQ. More information about PL/SQL can be obtained from the PL/SQL FAQ.

    The Mod_PLSQL Architecture:

    
    	+-CLIENT-+                +-----------------S E R V E R---------------+
    	|        |                |                                           |
    	|   Web  | <--Internet--> | Oracle HTTP <--> mod_plsql <-->  Oracle   |
    	| Browser|      HTTP      |   Server                        Database  |
    	|        |                |                                           |
    	+--------+                +-------------------------------------------+
    

  • Back to top of file

  • How does one start and stop MOD_PLSQL?

    By default MOD_PLSQL is started when the Oracle HTTP Server is started.

  • Back to top of file

  • How does one configure MOD_PLSQL?

    Start a Web Browser like Netscape Navigator and Internet Explorer and navigate to the MOD_PLSQL Gateway Configuration Menu (http://your.host.name:7777 and click on "mod_plsql"). Click on "Gateway Database Access Descriptor Settings". Select one of the options to add a new DAD (Database Access Descriptor). Enter at least the following fields: Click on "Apply" to make your changes permanent.

    Configuration parameters and log files are stored in the $ORACLE_HOME/Apache/modplsql subdirectory.

  • Back to top of file

  • How does one program using MOD_PLSQL?

    Standard Oracle PL/SQL programs can be extended to include MOD_PLSQL The Oracle Web Agent extends the Common Gateway Interface (CGI) to Oracle PL/SQL stored procedures. Programming is done in PL/SQL using the following set of packaged procedures:
    Example PL/SQL procedure:
    	CREATE OR REPLACE PROCEDURE HelloWorld AS
    	BEGIN
    		htp.htitle('My first dynamic Web page');
    		htp.print('Hello world');
    		htp.line;
    	END HelloWorld;
    	/
    To run this example you would typically provide an URL like this to your Web Browser:

    	 http://your.host.name/pls/<DAD_NAME>/HelloWorld

  • Back to top of file

  • How does one use HTTP COOKIEs?

    Cookies allow any site to store information on a WEB Browser's hard disk (cookie.txt file). This information is sent back to the originating site whenever you access it again.

    Look at this code example:

    	owa_util.mime_header ('text/html', FALSE);
    	owa_cookie.send (cuid, xsession_id, sysdate+1);
    	owa_util.http_header_close;
    
  • Back to top of file

  • Can a Web page be refreshed/reloaded after a given interval?

    Yes, use the OWA_UTIL.REDIRECT_URL function. Alternitavely, look at the code example below:
    	<HTML>
    	<HEAD>
    	<META HTTP-EQUIV="REFRESH" CONTENT="3; URL=any_valid_url">
    	<TITLE>Stay tuned!  3 Seconds until relocation</TITLE>
    	...
    	</HTML>
    
  • Back to top of file

  • Where can one get more info about MOD_PLSQL?

  • Back to top of file
  • HOME | ASK QUESTION | ADD FAQ | SEARCH | E-MAIL US