---
title: "TO_HEX"
description: "La funzione SQL TO_HEX converte un BLOB in un testo in notazione esadecimale."
language: it
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/it/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:10Z
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)) --> TO_HEX[TO_HEX]:::quoted
    TO_HEX --> End((END))
```

## Scopo
La funzione SQL `TO_HEX` converte un `blob` in una stringa di testo in notazione esadecimale.

Vedi anche [[ASCII_TO_BLOB]], [[BLOB_TO_TEXT]] e [[HEX_TO_BLOB]].

Parametri:
- Input (`blob`): valore da convertire in notazione esadecimale.

Risultato: l'`blob` viene convertito in testo in notazione esadecimale come `varchar2`.

## Esempi
L'esempio seguente recupera la rappresentazione esadecimale di un GUID:
```sql
select to_hex(newid())

--------------------------------------
cde6acae957b492ea304bfd8692f1ace
```
L'esempio seguente recupera la rappresentazione esadecimale di una variante compressa con GZIP del carattere ASCII a un byte `x`:
```sql
select to_hex(gzip('eA=='))

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

