Converts binary data to string data using Hexadecimal encoding. Encode data when you want to store data in a database or file that does not allow binary data. You can also encode data to pass binary data through transformations in string format. The encoded data is double the length of the original binary data. It displays as the characters 0 through 9 and A through F.
To use the
ENC_HEX
function, set the environment variable
INFA_ENABLE_BINARY_FUNCTIONS
to True or Yes.
Syntax
ENC_HEX(
value
)
The following table describes the argument for this command:
Argument
Required/
Optional
Description
value
Required
Binary datatype. Data that you want to encode in hex.
Return Value
Hex encoded string value.
NULL if the input is a null value.
Example
You want to read messages from WebSphere MQ and write the data to a flat file target. You want to include the WebSphere MQ message ID as part of the target data. However, the MsgID field is Binary, and the flat file target does not support binary data. Use ENC_HEX to encode the MsgID before the PowerCenter Integration Service writes the data to the target.