| Definition | Additional
Information |
Dynamic pages allow you to display dynamic content on a Web page. You use the dynamic page build wizard to specify any HTML code that creates a Web page. You can type your own HTML or copy it from another Web page editor. After this, you add code enclosed in <ORACLE></ORACLE> tags, whose executed results display on the page. The code can be a SQL statement or a PL/SQL block.
When an end user requests the Web page, its content is generated from current data in the database, based on the code you specified between the <ORACLE> </ORACLE> tags. The code automatically executes every time an end user requests the page.
You can create a page that automatically executes a SQL SELECT statement on a database table, then displays the query results in the page. You can also set up pages to automatically execute functions and procedures and display the results on the page.
For example:
<HTML>
<HEAD>
<TITLE>Example</TITLE>
</HEAD>
<BODY>
<h2>Example of Dynamic
Page</h2>
<H3>Before Raise</H3>
<ORACLE>select *
from scott.emp where deptno = :dept</ORACLE>
<h3>Raise</h3>
<ORACLE>
declare
l_raise number;
begin
l_raise := :raise_val;
htp.p('Give '||l_raise||'
raise to department '||:dept); htp.br;
scott.give_raise(:dept,
l_raise);
end;
</ORACLE>
<h3>After Raise</h3>
<ORACLE>select *
from scott.emp where deptno = :dept</ORACLE>
</BODY>
</HTML>
Copyright © 2005, Oracle. All rights reserved.