---
title: "JSONFORMAT"
description: "JSONFORMAT SQL\u95A2\u6570\u306F\u3001\u30A4\u30F3\u30C7\u30F3\u30C8\u3092\u4F7F\u7528\u3057\u3066JSON\u30C6\u30AD\u30B9\u30C8\u3092\u6574\u5F62\u8868\u793A\u3057\u307E\u3059\u3002"
language: ja
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/ja/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:10Z
license: https://documentation.invantive.eu/ja/
---

## 構文
```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))
```

## 目的
`JSONFORMAT` SQL関数は、インデントを使用してJSONテキストを整形表示します。

関連項目: [[JSONDECODE]]、[[JSONELEMENT]]、[[JSONENCODE]]、[[XMLFORMAT]]。

パラメータ:
- Json (`varchar2`): 整形表示するJSONテキスト。

戻り値: 整形表示されたJSONテキスト。 入力が`null`または空の場合、`null`を返します。

## 例
次の例では、圧縮されたJSONテキストを整形表示します:
```sql
select jsonformat('{"name":"peter","age":21}')

-------------------
{
  "name": "peter",
  "age": 21
}
```
次の例では、配列を含む圧縮されたJSONテキストを整形表示します。各配列要素はそれぞれ別の行に配置されます:
```sql
select jsonformat('{"name":"peter","tags":["sql","json"]}')

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

