invantive documentationpart of invantive cloud
Invantive Support ForumsLog In / Sign Up

UNGZIP

Syntax

%%{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 value as blob.

Examples

The following example retrieves compressed and decompressed representation of the nine ASCII characters invantive:

select base64_encode(ungzip(gzip('aW52YW50aXZl')))

-------------------
aW52YW50aXZl

The following example retrieves the single byte character x from its GZIP-compressed representation:

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:

select length(ungzip(gzip(rpad('aW52YW50aXZl', 1200, 'aW52YW50aXZl'))))

-------------------
900