invantive documentationpart of invantive cloud
Invantive Support ForumsLog In / Sign Up

BASE64_ENCODE

Syntax

%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> BASE64_ENCODE[BASE64_ENCODE]:::quoted
    BASE64_ENCODE --> FUNCPARS1["("]:::quoted
    FUNCPARS1 --> FUNCPARS2[parameters]
    FUNCPARS2 --> FUNCPARS3[")"]:::quoted
    FUNCPARS3 --> End((END))

Purpose

The BASE64_ENCODE SQL function converts a binary object to base64 encoded characters as defined in RFC 4648.

See also BASE64_DECODE.

Parameters:

  • Input (blob): value to convert to base64 characters.

Returns: the binary input encoded to base64 characters as varchar2.

Examples

BASE64_ENCODE maps the text hi first as ASCII 7-bit to a binary object, and then to the base64 representation:

select base64_encode(ascii_to_blob('hi'))

--------
aGk=

BASE64_ENCODE maps a longer ASCII 7-bit text to the base64 representation:

select base64_encode(ascii_to_blob('This is a base64 test'))

----------------------------------------------------
VGhpcyBpcyBhIGJhc2U2NCB0ZXN0