Top Previous Next TOC Index

Procedure and Function Reference


This section describes each procedure and function in the htp, htf, and owa_util packages. Please note that for every htp procedure that generates HTML tags, a corresponding htf function exists with identical parameters. Note that defaulted parameters do not need to be passed.

The description of each procedure or function is broken down into the following parts. Note that items for which no "generates" entry is shown are available only as procedures.


Parameters Passed into Procedures and Functions

All parameters passed into a hypertext procedure or function are of data type varchar2 (varying-length character string), integer, or date. The data type is indicated by the first letter of the parameter's name, "c" for character (varchar2), "n" for number (integer), and "d" for date. For example:

cname in varchar2

The "c" in cname indicates a character data type (varchar2).

nsize in integer

The "n" in nsize indicates a number data type (integer).

dbuf in date

The "d" in dbuf indicates a date data type (date).

As in BNF notation, a vertical bar (|) in the syntax diagram means "or".

Note: Many HTML 3.0 tags have a large number of optional attributes that, if passed as individual parameters to the hypertext procedures or functions would make the calls quite cumbersome. In addition, some browsers support non-standard attributes. Therefore, each hypertext procedure or function that generates an HTML tag has as its last parameter cattributes, an optional parameter. This parameter enables you to pass the exact text of the desired HTML attributes to the PL/SQL procedure.

For example, the syntax for htp.em is:

htp.em (ctext, cattributes);

A call that uses HTML 3.0 attributes might look like the following:

htp.em('This is an example','ID="SGML_ID" LANG="en"');

This line would generate the following:

<EM ID="SGML_ID" LANG="en">This is an example</EM>


Print Procedures

The following print procedures are used in conjunction with htf functions to generate a line in the HTML document being constructed. They can also be passed hard-coded text that will appear in the HTML document as-is. The generated line is passed to the PL/SQL Agent, which sends it to standard output. As documented in the CGI 1.1 specification, the Oracle Web Listener takes the contents of standard output and returns it to the Web browser that requested the dynamic HTML document.


htp.print

Syntax
htp.print (cbuf | dbuf | nbuf);

Purpose
generates a line in an HTML document.

Parameters
cbuf in varchar2 or
dbuf in date or
nbuf in number

Generates
Generates a line in an HTML document based on the value passed to it.


htp.prn

Alias for htp.print

Syntax
htp.prn (cbuf | dbuf | nbuf);

Purpose
Just like htp.print, but doesn't put a new line at the end of the value submitted.


htp.prints

Syntax
htp.prints (ctext);

Purpose
Generates a line in an HTML document and replaces all occurrences of the following special characters with the shown escape characters. If not replaced, the special characters would be interpreted as HTML control characters, and would produce garbled output.

`<` with '&lt;`
`>' with '&gt;`
`"` with `&quot;`
`&` with `&amp;`

Parameters
ctext in varchar2

Generates
Generates a line in an HTML document based on the value passed to it. This procedure is the same as htp.print or htp.p but first replaces the special characters listed above with escape characters.


htp.ps

Alias for htp.prints


Structure Tags

The following tags are used to identify the major parts of an HTML document.

Note: Although this section shows hypertext procedures (HTP), all of them are also available as hypertext functions (HTF).


htp.htmlOpen

Syntax
htp.htmlOpen;

Purpose
Prints a tag that indicates the beginning of an HTML document

Parameters
none

Generates
<HTML>


htp.htmlClose

Syntax
htp.htmlClose;

Purpose
Prints a tag that indicates the end of an HTML document

Parameters
none

Generates
</HTML>


htp.headOpen

Syntax
htp.headOpen;

Purpose
Prints a tag that indicates the beginning of the HTML document head

Parameters
none

Generates
<HEAD>


htp.headClose

Syntax
htp.headClose;

Purpose
Prints a tag that indicates the end of the HTML document head

Parameters
none

Generates
</HEAD>


htp.bodyOpen

Syntax
htp.bodyOpen (cbackground, cattributes);

Purpose
Prints the tag that identifies the beginning of the body of an HTML document, and allows you to specify an image as the background of the document

Parameters
cbackground in varchar2 DEFAULT NULL
cattributes in varchar2 DEFAULT NULL

Generates
<BODY background="cbackground" cattributes>

Note: If cbackground and cattributes are NULL, this tag generates <BODY>.

Example
htp.bodyOpen ('/img/background.gif');

This line produces:

<BODY background="/img/background.gif">


htp.bodyClose

Syntax
htp.bodyClose;

Purpose
Defines the end of the HTML document body

Parameters
none

Generates
</BODY>


Click Here to Go to the top of the section.

Click Here to Go to the previous topic.

Click Here to Go to the next topic.

Click here to Go to the Table of Contents.

Click here to Go to the Index.


This document was last modified at 05:39pm PST on March 27, 1996.

To report any problems or comments, e-mail Oracle WebServer Documentation.