DNFMWHFINMSG: HEX to VARCHAR
The user-defined DB2® function (UDF) DNFMWHFINMSG extracts the contents of the innermost <BLOB> element of the specified column, and uses the ibm-1047 or UTF-8 code page (whichever is appropriate) to convert it from hexadecimal characters to a variable-length character (VARCHAR) representation. The output VARCHAR string has a maximum length of 32672 bytes.
If the specified column does not contain a <BLOB> element, the result is the NULL value. If the <BLOB> element is empty, the result is an empty string.
For example, in the following message, the <BLOB>
element contains the hex data X'C0C6F0F1':
<Msg>
:
<BLOB>
<BLOB>
C0C6F0F1
</BLOB>
</BLOB>
</Msg> If the specified column contains this message,
DNFMWHFINMSG returns the following characters: {F01DNFMWHFINMSG might return one of the following SQLSTATE
values for a message:
- 38W00
- The set of <BLOB><BLOB> tags that precedes the FIN message is not terminated by a set of </BLOB></BLOB> end tags.
- 38W01
- Character conversion is not supported. The code page must be ibm-1047 or UTF-8.
- 38W02
- The FIN message contains non-hexadecimal characters.
