BASE64_ENCODE()
All functions > STRING > BASE64_ENCODE()
Encodes a string as standard Base64 text.
Signatures
Returns: Base64-encoded representation
BASE64_ENCODE(string: VARCHAR) → VARCHAR sql
| Parameter | Type | Required | Description |
|---|---|---|---|
string | VARCHAR | Yes | Input text to encode |
Notes
- Uses the usual Base64 alphabet with padding
- Operates on the underlying byte representation of the text
- Returns NULL if the input is NULL (use
NULL(VARCHAR); bareNULLfails inference) - Pair with
BASE64_DECODEto recover the original string when the payload is valid Base64
See also
Examples
FeatureQL
SELECT
f1 := BASE64_ENCODE('hello'), -- ASCII text
f2 := BASE64_ENCODE(''), -- Empty string
f3 := BASE64_ENCODE(NULL(VARCHAR)) -- NULL yields NULL
;Result
| f1 VARCHAR | f2 VARCHAR | f3 VARCHAR |
|---|---|---|
| aGVsbG8= | (empty) | NULL |
On this page