||Donald K. Burleson
Oracle Utilities Tips
PL/SQL Server Pages (PSP)
Executing the PSP from SQL*Plus
The PSP can be executed from SQL*Plus, and using the owa_util package, the
HTML output will be displayed. When accessing the owa_util package from
SQL*Plus, package variables need to be initialized first, otherwise an
error will occur on the first execution. Subsequent executions will work
fine, just not the first one. To get around this limitation of the owa
utilities, add the following code to the login.sql script located in the
OWA.INIT_CGI_ENV(0, NAME_ARR, VALUE_ARR);
Now the PSP execution will be successful on the first attempt:
SQL> set serveroutput on
SQL> execute parmlistpsp;
PL/SQL procedure successfully completed.
SQL> execute owa_util.showpage;
<HEAD><TITLE>This is a PSP Page!</TITLE></HEAD>
This is a
list of current database parameters: <BR><BR>
Notice from the output above that the text is pure HTML. Oracle executed
our query and formatted the HTML including the data returned from the
query. The next step is to access this HTML from a web browser.
To learn more about
these techniques, see the book "Advanced
Oracle Utilities: The Definitive Reference".
You can buy it directly
and get instant access to the code depot of utilities scripts.