BASE64_ENCODE
The BASE64_ENCODE scalar function returns the Base64 encoded version of a binary value.
- binary-string
- An expression that returns a built-in binary string to be encoded.
The result of the function is a CLOB in CCSID 1208 that contains the bytes of binary-string as a Base64-encoded string.
Examples
- Encode a string that contains the value
X'1122334455'.
The result is: ESIzRFU=.VALUES QSYS2.BASE64_ENCODE(X'1122334455');
- Encode a character string that contains the EBCDIC value
'ABC'.
The result is: wcLDVALUES QSYS2.BASE64_ENCODE('ABC');
- Encode a UTF-8 string that contains the value
'ABC'.
The result is: QUJDVALUES QSYS2.BASE64_ENCODE(CAST('ABC' AS VARCHAR(10) CCSID 1208));