From Oracle FAQ
Jump to: navigation, search

PL/SQL Server Pages (PSP) is a technology similar to ASP (Active Server Pages) and JSP (Java Server Pages).

The basic design (HTML page) is created in a visual tool, for instance an HTML designer and the PL/SQL code (also called scriptlets) is embedded within special tags. Only the absolute minimum of PL/SQL will have to be written and the HTML designer and PL/SQL programmer can share the same file. A PSP file is compiled into a PL/SQL stored procedure, which means that the PSP compile is used during the development phase only.


[edit] History

PSP was first introduced with Oracle 8i (8.1.6).

[edit] Sample PSP pages

<%@ page language="PL/SQL" %>
<%@ plsql procedure="hello" %>
<%@ plsql parameter="username" default="NULL"%>
     IF username IS NOT NULL THEN
        Hello <%= username %>
        No username provided!
     END IF;

A more complicated example:

 <%@ page language="PL/SQL" %> 
 <%@ plsql procedure="Parameters" %> 
 <HEAD><TITLE>This is a Test PSP Page</TITLE></HEAD> 

 <h1>List of database parameters:</H1>
 <% FOR parm IN (select name, value from sys.v_$parameter
 order by name) 
   IF parm.value IS NULL THEN 
      parm.value := 'no value'; 
   END IF;
   <TD><%= %></TD>
   <TD><%= parm.value %></TD>
 <% END LOOP; %>


[edit] Deploying PSP pages

To compile a psp file, say hellp.psp:

loadpsp -replace -user name/pass hellp.psp

[edit] Also see

  • Mod_plsql - Apache PL/SQL module
  • APEX - Oracle Application Express
Glossary of Terms
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z #