This topic describes how to use the string function TO_BASE64 in Realtime Compute.

Syntax

VARCHAR TO_BASE64(bin)         

Input parameters

Parameter Data type
bin BINARY

Description

Converts BINARY data to a Base64-encoded string.

Example

  • Test data
    c (VARCHAR)
    SGVsbG8gd29ybGQ=
    SGk=
    SGVsbG8=
  • Test statements
    SELECT  TO_BASE64(FROM_BASE64(c)) as var1
    FROM T1;       
  • Test results
    var1 (VARCHAR)
    SGVsbG8gd29ybGQ=
    SGk=
    SGVsbG8=