Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
The iQuery.encode_URL() UDF inspects the input string and "escapes" all necessary characters by converting them to ASCII and then converting that ASCII to hexadecimal.
This is primarily used for iQuery for Web applications to encode URL links that are sent back to the web browser.
UDF | Return Type | Description |
encode_URL | varchar(8192) | Encodes (sometimes called "escapes") the input string and returns it as a varchar value. |
iQuery.encode_URL( input string varchar(4096), ccsid default 1208)
The input-string parameter can be any textual data that will be encoded for web output. Up to 4k (4096 bytes) may be specified.
The cssid parameter identifies the CCSID to which the input is converted before being escaped. The un-encoded text is not converted to ASCII, only the characters that are encoded are. This is necessary to insure the proper ASCII hex values are inserted into the returned varchar string.
select custno, iquery.encode_URL(custAddr), iquery.encode_TAG(phone)
FROM customer;