---
title: "TO_HEX"
description: "TO_HEX SQL\u95A2\u6570\u306F\u3001BLOB\u309216\u9032\u6570\u8868\u8A18\u306E\u30C6\u30AD\u30B9\u30C8\u306B\u5909\u63DB\u3057\u307E\u3059\u3002"
language: ja
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/ja/docs/invantive-universalsql/grammar/sql-functions/to-hex
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/to-hex
updated: 2026-12-04T14:38:14Z
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)) --> TO_HEX[TO_HEX]:::quoted
    TO_HEX --> End((END))
```

## 目的
`TO_HEX` SQL関数は、`blob`を16進数表記のテキストに変換します。

[[ASCII_TO_BLOB]]、[[BLOB_TO_TEXT]]、[[HEX_TO_BLOB]]もあわせて参照してください。

パラメータ:
- 入力 (`blob`): 16進数表記に変換する値。

戻り値: 16進数表記のテキストに変換された`blob`（型は`varchar2`）。

## 例
次の例では、GUIDの16進数表記を取得します:
```sql
select to_hex(newid())

--------------------------------------
cde6acae957b492ea304bfd8692f1ace
```
次の例では、単一バイトASCII文字`x`のGZIP圧縮版の16進数表記を取得します:
```sql
select to_hex(gzip('eA=='))

--------------------------------------
1F8B0800E4BF266A00FFAB00008316DC8C01000000
```

