ENCODE

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Encodes binary data into a textual representation.

Syntax 

1encode(<data>, <format>)

Arguments 

Required 

  • <data>: The binary data to encode.
  • <format>: The format to use when encoding the string (base64, hex, or escape).

Returns 

Returns a text value that contains the encoded representation.

Considerations 

  • The escape format converts zero bytes and high-bit-set bytes to octal sequences.

Examples 

Encode to Base64 

Encode binary data to base64.

1SELECT encode('123\000\001', 'base64') AS result;

Returns 'MTIzXDAwMFwwMDE='.

Related Documentation 

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!