-
Visit my blog
read all about bochgoch
- What is systems thinking?
- When is a system a system
- Complexity
- Beliefs
- Information Gathering
- Methodology Method Tool
- Sustainable Development
- Reflection
- Success
Oracle Application Server
The PSP Hello World
PSP's (PLSQL Pages) provide a powerful and easy method for extracting Oracle database data and serving it up via a web page.You'll need to create a DAD (Database Access Descriptor) to your database (the connection from mod_plsql to the database) within which you're storing your PLSQL Pages:
Login to Enterprise Manager (http://your.server.name:1810) as ias_admin. Navigate to your HTTP Service (Farm > App Server > HTTP Server > PL/SQL Properties (at the bottom of the screen)) -- scroll down to DAD Status and click Create -- select general as connection type, enter connection string as usual and give your DAD a name (you'll need this as DADname in the URL below).
Then create a procedure on the database that your DAD points to, for example:
CREATE OR REPLACE PROCEDURE "HELLOWORLDPROC" AS
BEGIN NULL;
htp.prn('
<HTML>
<HEAD><TITLE>HELLO WORLD</TITLE></HEAD>
<BODY>
<br><br>
<B>
There are currently
');
for counter in (SELECT COUNT(*) rowsintable FROM DUAL) loop
htp.prn(' ');
htp.prn( counter.rowsintable );
htp.prn(' ');
end loop;
htp.prn(' rows in TABLE1
</BODY>
</HTML>
');
END;
/
Once this has been created you can access it using the following URL syntax:
http://your.server.name:7778/DADname/HELLOWORLDPROC
This demonstrates several things:
Use of a DAD to join browser to database.
htp.prn to generate HTML to your browser.
Outputing database information to the browser via a DAD.