Encodes special characters within strings to be inserted into HTML documents.
HTML_ENCODE( string )
LONG VARCHAR or LONG NVARCHAR.
This function returns the string argument after making the following set of substitutions:
| Characters | Substitution |
|---|---|
| " | " |
| ' | ' |
| & | & |
| < | < |
| > | > |
| codes nn less than 0x20 | &#xnn; |
This function supports NCHAR inputs and/or outputs.
The following example returns the string '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> '.
SELECT HTML_ENCODE('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">')