---
title: "ZLIB_COMPRESS"
description: "ZLIB_COMPRESS SQL-funktionen komprimerer en BLOB ved hj\u00E6lp af Zlib-algoritmen."
language: da
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/da/docs/invantive-universalsql/grammar/sql-functions/zlib-compress
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/zlib-compress
updated: 2026-12-04T14:57:52Z
license: https://documentation.invantive.eu/da/
---

## Syntaks
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> ZLIB_COMPRESS[ZLIB_COMPRESS]:::quoted
    ZLIB_COMPRESS --> End((END))
```

## Formål
Den `ZLIB_COMPRESS` SQL-funktion komprimerer en `blob` ved hjælp af Zlib-algoritmen.

Se også [[ZLIB_DECOMPRESS]] og [[GZIP]].

Parametre:
- input (`blob`): Den `blob`, der skal komprimeres.

Returnerer: en Zlib-komprimeret version af input.

## Eksempler
Følgende eksempel komprimerer og dekomprimerer de ni ASCII-tegn `ACME` og henter den oprindelige tekst:
```sql
select blob_to_text(zlib_decompress(zlib_compress(ascii_to_blob('ACME'))))

-------------------
ACME
```
Følgende eksempel komprimerer en tekst og henter den komprimerede `blob`-kodning som base64:
```sql
select base64_encode(zlib_compress('VGhpcyBpcyBhIHZlcnkgbG9uZyB0ZXh0IHRvIHRlc3QgdGhlIFpMaWIgY29tcHJlc3Npb24gbWV0aG9k'))

-------------------
eJwFwbkNgEAQA8BWXBAhERmPxa7E3aKzhaB7ZuZIIYUVD8eHq/oJ8zVcMGU4iGXKDXu1e1DK6mh01PEDjdMV+Q==
```

