The description of each procedure or function is broken down into the following parts:
Name | Name of procedure or function |
Syntax | Actual syntax of procedure or function |
Purpose | What the procedure or function does |
Parameters | Parameters passed in |
Generates | What the procedure or function generates |
Note: Many HTML 3.0 tags have a large number of optional attributes that, if made 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>
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. |
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. |
Syntax | htp.prints (ctext); |
Purpose | Generates a line in an HTML document and replaces all occurrences of the following special characters with escape characters. If not replaced, the special characters would be interpreted as HTML control characters, and would produce garbled output. |
`<` with '<` `>' with >` `"` with `"` `&` with `&` | |
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. |
Note: Although this section shows hypertext procedures (HTP), all of them are also available as hypertext functions (HTF).
Syntax | htp.htmlOpen; |
Purpose | Prints a tag that indicates the beginning of an HTML document |
Parameters | none |
Generates | <HTML> |
Syntax | htp.htmlClose; |
Purpose | Prints a tag that indicates the end of an HTML document |
Parameters | none |
Generates | </HTML> |
Syntax | htp.headOpen; |
Purpose | Prints a tag that indicates the beginning of the HTML document head |
Parameters | none |
Generates | <HEAD> |
Syntax | htp.headClose; |
Purpose | Prints a tag that indicates the end of the HTML document head |
Parameters | none |
Generates | </HEAD> |
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> |
Example | htp.bodyOpen ('/img/background.gif'); This line produces: <BODY background="background.gif"> |
Syntax | htp.bodyClose; |
Purpose | Defines the end of the HTML document body |
Parameters | none |
Generates | </BODY> |