## Syntax
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> | | HEX_TO_BLOB[HEX_TO_BLOB]:::quoted
HEX_TO_BLOB --> End((END))
```
## Purpose
The `HEX_TO_BLOB` SQL function casts a text in hexadecimal notation to the corresponding BLOB.
See also [[ASCII_TO_BLOB]], [[BLOB_TO_TEXT]] and [[TO_HEX]].
Parameters:
- Text (`varchar2`): text in hexadecimal notation with two characters per byte.
Returns: the hexadecimal notation of the BLOB as a `blob`.
## Examples
The following example creates a BLOB of 3 bytes and determines it's length:
```sql
select length(hex_to_blob('684C13'))
-------------------
3
```
The following example creates a hexadecimal notation of 300 characters, repeating the same 3 bytes 100 times, and then determines it's length:
```sql
select length(hex_to_blob(rpad('684C13', 300, '684C13')))
-------------------
150
```
The following example creates a hexadecimal notation of 300 characters, repeating the same 3 bytes 100 times, compresses it using GZIP, and then determines the length of the compressed BLOB:
```sql
select length(gzip(hex_to_blob(rpad('684C13', 300, '684C13'))))
-------------------
25
```