BASE64ENCODE scalar function
The BASE64ENCODE function returns the Base64 encoded version of the binary values of a character string.
The schema is SYSTOOLS.
- character-string
- A character expression to be encoded. The maximum length in 2732 characters.
The result of the function is a varying length character string in CCSID 1208 that contains the bytes of character-string as a Base64-encoded string.
Example
- Encode a string that contains the value X'1122334455'.
The result is: ESIzRFU=.VALUES SYSTOOLS.BASE64ENCODE(X'1122334455');
- Encode a character string in CCSID 37 that contains the value
'ABC'.
The result is: wcLDVALUES SYSTOOLS.BASE64ENCODE('ABC');
- Encode a UTF-8 string that contains the value
'ABC'.
The result is: QUJDVALUES SYSTOOLS.BASE64ENCODE(CAST('ABC' AS VARCHAR(10) CCSID 1208));