14-2. Creating a Common Set of HTML Page Generation Procedures

Problem

Every web page you generate with a PL/SQL procedure requires a common HTML tag to start and another to finish every web page, and you do not wish to repeat the code to add those tags in every procedure you write for the Web.

Solution

Create a package that contains calls to the PL/SQL Web Toolkit procedures that produce the HTML code necessary to properly display a well-formed,1 HTML web page. In this example a package is created with two procedures, one to generate the HTML tags required to start a page and one to generate the closing HTML tags to finish a page.

CREATE OR REPLACE PACKAGE common AS    PROCEDURE header (title VARCHAR2);    PROCEDURE footer; END common;

Get Oracle and PL/SQL Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.