---
title: "ZLIB_COMPRESS"
description: "Die SQL-Funktion ZLIB_COMPRESS komprimiert ein BLOB mit dem Zlib-Algorithmus."
language: de
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/de/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/de/
---

## Syntax
```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))
```

## Anwendung
Die SQL-Funktion `ZLIB_COMPRESS` komprimiert ein `blob` mithilfe des Zlib-Algorithmus.

Siehe auch [[ZLIB_DECOMPRESS]] und [[GZIP]].

Parameter:
- Eingabe (`blob`): Das `blob`, das komprimiert werden soll.

Gibt eine mit Zlib komprimierte Version der Eingabe zurück.

## Beispiele
Im folgenden Beispiel werden die neun ASCII-Zeichen `ACME` komprimiert und wiederhergestellt, und der ursprüngliche Text wird abgerufen:
```sql
select blob_to_text(zlib_decompress(zlib_compress(ascii_to_blob('ACME'))))

-------------------
ACME
```
Im folgenden Beispiel wird ein Text komprimiert und das komprimierte `blob`, das als Base64 kodiert ist, abgerufen:
```sql
select base64_encode(zlib_compress('VGhpcyBpcyBhIHZlcnkgbG9uZyB0ZXh0IHRvIHRlc3QgdGhlIFpMaWIgY29tcHJlc3Npb24gbWV0aG9k'))

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

