---
title: "BASE64_DECODE"
description: "BASE64_DECODE SQL\u95A2\u6570\u306F\u3001base64\u3067\u30A8\u30F3\u30B3\u30FC\u30C9\u3055\u308C\u305F\u5024\u3092\u3001RFC 4648 \u3067\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308B\u30D0\u30A4\u30CA\u30EA\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306B\u623B\u3057\u307E\u3059\u3002"
language: ja
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/ja/docs/invantive-universalsql/grammar/sql-functions/base64-decode
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/base64-decode
updated: 2026-12-04T13:21:12Z
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)) --> BASE64_DECODE[BASE64_DECODE]:::quoted
    BASE64_DECODE --> End((END))
```

## 目的
`BASE64_DECODE` SQL関数は、base64でエンコードされた値を、RFC 4648](https://www.rfc-editor.org/rfc/rfc4648) で定義されているバイナリオブジェクトに戻します。

参照：[[BASE64_ENCODE]]。

パラメータ:
- 入力 (`varchar2`): 元に戻す値。

戻り値: 入力をデコードして戻したバイナリ値 (`blob`)。

## 例
`BASE64_DECODE` は、テキスト `aGk=` をバイナリオブジェクトに変換し、さらに 7 ビットASCII文字セットのテキストに変換します:
```sql
select blob_to_text(base64_decode('aGk='), 'ASCII')

--------
hi
```
`BASE64_DECODE` は、base64でエンコードされたテキストをバイナリオブジェクトに変換し、さらに `TO_CHAR` を使ってテキストに変換します:
```sql
select to_char(base64_decode('VGhpcyBpcyBhIGJhc2U2NCB0ZXN0'))

----------------------
This is a base64 test
```

