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_TAG() 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 data that is inserted withing an HTML "tag" keyword. Normally parameter data for things like alt= or title= encoded in this manner. This UDF is far less thorough that the encode_URL UDF as it is not intended to be used for ilnks on the href= keyword.
UDF | Return Type | Description |
encode_TAG | varchar(8192) | Encodes (sometimes called "escapes") the input string and returns it as a varchar value. |
iQuery.encode_TAG( 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 ccsid 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 they proper ASCII hex values are inserted into the returned varchar string.
select custno, iquery.encode_URL(custAddr), iquery.encode_TAG(phone)
FROM customer;