---
title: "JSONFORMAT"
description: "La funzione SQL JSONFORMAT formatta il testo JSON in modo leggibile utilizzando i rientri."
language: it
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/it/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/it/
---

## Sintassi
```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))
```

## Scopo
La funzione SQL `JSONFORMAT` formatta il testo JSON utilizzando l'indentazione.

Vedi anche [[JSONDECODE]], [[JSONELEMENT]], [[JSONENCODE]] e [[XMLFORMAT]].

Parametri:
- JSON (`varchar2`): testo JSON da formattare in modo leggibile.

Restituisce: il testo JSON formattato in modo leggibile. Restituisce `null` quando l'input è `null` o vuoto.

## Esempi
L'esempio seguente formatta in modo leggibile un testo JSON compatto:
```sql
select jsonformat('{"name":"peter","age":21}')

-------------------
{
  "name": "peter",
  "age": 21
}
```
L'esempio seguente formatta in modo leggibile un testo JSON compatto contenente un array; ogni elemento dell'array viene posizionato su una riga a sé stante:
```sql
select jsonformat('{"name":"peter","tags":["sql","json"]}')

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

