Call for Oracle support & training (800) 766-1884
Free Oracle Tips

Home
 
Corporate Oracle Training
Custom Oracle Training
Oracle New Features Training
Advanced Oracle DBA Classes
Oracle Tuning Courses
Oracle Tips & Tricks
Oracle Training Links
Oracle Training Links
Oracle Training Links

We are top for USA Oracle Training Clients

 

Free Oracle Tips


 
HTML Text AOL

Free Oracle App Server Tips


 
HTML Text

Oracle support

Oracle training

Oracle tuning

Rednecks!

Remote Oracle

Custom Oracle Training

Donald K. Burleson

Oracle Utilities Tips

Loading PL/SQL Server Pages

The loadpsp utility loads a PSP (PL/SQL Server Page) file from the operating system into the database. The loaded PSP can then be accessed from a URL to display database content on a web page.

PL/SQL Server Pages (PSP) are Oracle's answer to the more common Java Server pages. It provides a convenient way for developers to display database content on web pages. By simply accessing a URL that points to a PSP, the result set of the data is displayed on the web page in the HTML format the developer has specified.

The PL/SQL Web Toolkit ships as part of the database in Oracle 9i. The file below (Parmlist.psp) will serve as the example in which the web page will display the parameter names and values from the v$parameter table.
This simple PSP accesses the name and value from the v$paramater table and formats them in very basic HTML. Additional logic is added to check for null parameter values, in which case null will be displayed.

SEE CODE DEPOT


The PSP file can be loaded from the DOS or UNIX prompt using loadpsp:

C:\oracle9i\bin> loadpsp -replace -user scott/tiger Parmlist.psp
"Parmlist.psp": procedure "ParmListPSP" created.

The procedure is now queried from the data dictionary:

SQL> select text from user_source where name = 'PARMLISTPSP' order by line;

TEXT
----------------------------------------------------------------
PROCEDURE ParmListPSP AS
BEGIN NULL;
htp.prn('
');
htp.prn('
<HTML>
<HEAD><TITLE>This is a PSP Page!</TITLE></HEAD>
<BODY>
This is a list of current database parameters: <BR><BR>

');

FOR parm IN (select name, value from v$parameter
order by name)
LOOP
if parm.value is null then
parm.value := 'null';
end if;

htp.prn('
<TR>
<TD>');
htp.prn( parm.name );
htp.prn('</TD>
=
<TD>');
htp.prn( parm.value );
htp.prn('</TD><BR>
</TR>
');
END LOOP;
htp.prn('
</BODY>
</HTML>


');
END;

37 rows selected.


The code generated by loadpsp looks different than the source that was submitted. The PSP executable has added some extra code into the body of the PSP code. The added code is mainly calls to the htp package. This package generates the HTML tags for the web page.


To learn more about these techniques, see the book "Advanced Oracle Utilities: The Definitive Reference". 

You can buy it directly from the publisher and get instant access to the code depot of utilities scripts.
 

 

 

 
 
 

Oracle performance tuning book

 

 

Oracle performance tuning software

 
Oracle performance tuning software
 
Oracle performance Tuning 10g reference poster
 
Oracle training in Linux commands
 
Oracle training Excel
 
 
 
 
 
email BC:


Copyright © 1996 -  2014 by Burleson Inc. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.