BASE64_ENCODE

functionsupportedCore SQL functions

docs.snowflake.com ↗

String & binary functions

Encodes the input (string or binary) using Base64 encoding.

Syntax

supportedpartialnot supportednot scored

BASE64_ENCODE( <input> [ , <max_line_length> ] [ , <alphabet> ] )

Parameters

NameRequiredDescription
inputrequiredA string or binary expression to be encoded.
max_line_lengthoptionalA positive integer that specifies the maximum number of characters in a single line of the output. Default: 0 (specifies that no line breaks are inserted (i.e. the maximum line length is infinite))
alphabetoptionalA string consisting of up to three ASCII characters: The first two characters in the string specify the last two characters (indexes 62 and 63) in the alphabet used to encode the input: A to Z (indexes 0-25) a to z (indexes 26-51) 0 to 9 (indexes 52-61) + and / (indexes 62, 63) Defaults: + and / The third character in the string specifies the character used for padding. Default: =

Returns

This returns a string that contains only the characters used for the base64 encoding.

Usage notes

See also

Referenced by