The TO_BASE64_BINARY function converts the input binary string into Base64 encoding format. Base64 encoding converts arbitrary binary data into a string composed of 64 characters.
TO_BASE64_BINARY(<bin>)
| Parameter | Description |
|---|---|
<bin> | The binary to be Base64 encoded. Type: VARBINARY |
Returns VARCHAR type, representing the Base64 encoded string.
Special cases:
SELECT to_base64_binary(x'12');
+-------------------------+ | to_base64_binary(x'12') | +-------------------------+ | Eg== | +-------------------------+
SELECT to_base64_binary(x'234AAA');
+-----------------------------+ | to_base64_binary(x'234AAA') | +-----------------------------+ | I0qq | +-----------------------------+