Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API
Encodes binary data into a textual representation.
Syntax
encode(<data>, <format>)
Arguments
Required
<data>: The binary data to encode.<format>: The format to use when encoding the string (base64,hex, orescape).
Returns
Returns a text value that contains the encoded representation.
Considerations
- The
escapeformat converts zero bytes and high-bit-set bytes to octal sequences.
Examples
Encode to Base64
Encode binary data to base64.
SELECT encode('123\000\001', 'base64') AS result;
Returns 'MTIzXDAwMFwwMDE='.