Skip to main content

Categories: Binary, Conversion

ENCODE

Encodes the input expression using the specified charSet character encoding.

Syntax

ENCODE(expression string, charSet_type string) → varbinary

  • expression: The expression to be encoded.
  • charSet_type: The charSet type to use for the conversion.

Examples

ENCODE example
SELECT ENCODE('Dremio', 'US-ASCII')
-- RHJlbWlv
ENCODE example
SELECT ENCODE('Dremio', 'UTF-16BE')
-- AEQAcgBlAG0AaQBv

Usage Notes

The charset must be one of (case-insensitive):

  • US-ASCII
  • ISO-8859-1
  • UTF-8
  • UTF-16BE
  • UTF-16LE
  • UTF-16