---
title: "JSONFORMAT"
description: "La fonction SQL JSONFORMAT met en forme le texte JSON en le pr\u00E9sentant avec une indentation."
language: fr
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/fr/docs/invantive-universalsql/grammar/sql-functions/jsonformat
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/jsonformat
updated: 2026-12-04T13:52:06Z
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)) --> JSONFORMAT[JSONFORMAT]:::quoted
    JSONFORMAT --> End((END))
```

## Objet
La fonction SQL `JSONFORMAT` formate le texte JSON à l'aide d'indentations.

Voir également [[JSONDECODE]], [[JSONELEMENT]], [[JSONENCODE]] et [[XMLFORMAT]].

Paramètres :
- Json (`varchar2`) : texte JSON à formater.

Renvoie : le texte JSON formaté. Renvoie `null` lorsque l'entrée est `null` ou vide.

## Exemples
L'exemple suivant formatise un texte JSON compact :
```sql
select jsonformat('{"name":"peter","age":21}')

-------------------
{
  "name": "peter",
  "age": 21
}
```
L'exemple suivant formate de manière lisible un texte JSON compact contenant un tableau ; chaque élément du tableau est placé sur une ligne distincte :
```sql
select jsonformat('{"name":"peter","tags":["sql","json"]}')

-------------------
{
  "name": "peter",
  "tags": [
    "sql",
    "json"
  ]
}
```

