Table of Contents Previous Next


3 Built-In Packages : 3.24 UTL_URL

3.24 UTL_URL
The UTL_URL package provides a way to escape illegal and reserved characters within an URL.
Use the ESCAPE function to escape any illegal and reserved characters in a URL.
The UNESCAPE function to convert an URL to it's original form.
The UTL_URL package will return the BAD_URL exception if the call to a function includes an incorrectly-formed URL.
3.24.1 ESCAPE
Use the ESCAPE function to escape illegal and reserved characters within an URL. The signature is:
url specifies the Uniform Resource Locator that UTL_URL will escape.
escape_reserved_chars is a BOOLEAN value that instructs the ESCAPE function to escape reserved characters as well as illegal characters:
If escaped_reserved_chars is FALSE, ESCAPE will escape only the illegal characters in the specified URL.
If escape_reserved_chars is TRUE, ESCAPE will escape both the illegal characters and the reserved characters in the specified URL.
By default, escape_reserved_chars is FALSE.
%7b and %7d
The ESCAPE function considers the following characters to be reserved, and will escape them if escape_reserved_chars is set to TRUE:
url_charset
url_charset specifies a character set to which a given character will be converted before it is escaped. If url_charset is NULL, the character will not be converted. The default value of url_charset is ISO-8859-1.
The following anonymous block uses the ESCAPE function to escape the blank spaces in the URL:
If you include a value of TRUE for the escape_reserved_chars parameter when invoking the function:
The ESCAPE function escapes the reserved characters as well as the illegal characters in the URL:
3.24.2 UNESCAPE
The UNESCAPE function removes escape characters added to an URL by the ESCAPE function, converting the URL to it's original form.
UNESCAPE(url VARCHAR2, url_charset VARCHAR2)
url specifies the Uniform Resource Locator that UTL_URL will unescape.
url_charset
After unescaping a character, the character is assumed to be in url_charset encoding, and will be converted from that encoding to database encoding before being returned. If url_charset is NULL, the character will not be converted. The default value of url_charset is ISO-8859-1.
The following anonymous block uses the ESCAPE function to escape the blank spaces in the URL:

3 Built-In Packages : 3.24 UTL_URL

Table of Contents Previous Next