## Syntax
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> UNGZIP[UNGZIP]:::quoted
UNGZIP --> End((END))
```
## Purpose
The `UNGZIP` SQL function decompresses a BLOB using the GZIP-algorithm.
See also [[GZIP]].
Parameters:
- input (`blob`): The BLOB to decompress. BASE64 decoding is applied automatically when a `varchar2` text is provided.
Returns: the decompressed BLOB as `blob`.
## Examples
The following example retrieves compressed and decompressed representation of the nine ASCII characters `invantive`:
```sql
select base64_encode(ungzip(gzip('aW52YW50aXZl')))
-------------------
aW52YW50aXZl
```
The following example retrieves the single byte character `x` from it's GZIP-compressed representation:
```sql
select to_char(ungzip('H4sIAHSxJmoA/6sAAIMW3IwBAAAA'))
-------------------
x
```
The following example retrieves the length of compressed and decompressed 1200 characters representing 100 times the BASE64 encoding of the nine ASCII characters `invantive`:
```sql
select length(ungzip(gzip(rpad('aW52YW50aXZl', 1200, 'aW52YW50aXZl'))))
-------------------
900
```