---
title: "BASE64_ENCODE"
description: "La fonction SQL BASE64_ENCODE convertit un objet binaire en caract\u00E8res encod\u00E9s en base64, comme d\u00E9fini dans la RFC 4648."
language: fr
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/fr/docs/invantive-universalsql/grammar/sql-functions/base64-encode
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/base64-encode
updated: 2026-12-04T13:21:30Z
license: https://documentation.invantive.eu/fr/
---

## Syntaxe
```mermaid
%%{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))
```

## Objet
La fonction SQL `BASE64_ENCODE` convertit un objet binaire en caractères encodés en base64, conformément à la définition donnée dans la [RFC 4648](https://www.rfc-editor.org/rfc/rfc4648).

Voir également [[BASE64_DECODE]].

Paramètres :
- Données d'entrée (`blob`) : valeur à convertir en caractères Base64.

Renvoie : la donnée binaire encodée en caractères Base64 sous la forme `varchar2`.

## Exemples
`BASE64_ENCODE` convertit d'abord le texte `hi` en un objet binaire de 7-bit au format ASCII, puis en représentation base64 :
```sql
select base64_encode(ascii_to_blob('hi'))

--------
aGk=
```
`BASE64_ENCODE` convertit un texte ASCII plus long 7-bit en représentation base64 :
```sql
select base64_encode(ascii_to_blob('This is a base64 test'))

----------------------------------------------------
VGhpcyBpcyBhIGJhc2U2NCB0ZXN0
```

