Documentation Invantiveune partie de Invantive cloud
Forums d'Invantive SupportConnectez-vous/inscrivez-vous

ZLIB_COMPRESS

Syntaxe

%%{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))

Objet

La fonction SQL ZLIB_COMPRESS compresse une image blob à l'aide de l'algorithme Zlib.

Voir également ZLIB_DECOMPRESS et GZIP.

Paramètres :

  • Entrée (blob) : l'image blob à compresser.

Renvoie : une version compressée au format Zlib de la donnée d'entrée.

Exemples

L'exemple suivant compresse et décompresse les neuf caractères ASCII ACME, puis récupère le texte d'origine :

select blob_to_text(zlib_decompress(zlib_compress(ascii_to_blob('ACME'))))

-------------------
ACME

L'exemple suivant compresse un texte et récupère l'blob compressé, encodé en base64 :

select base64_encode(zlib_compress('VGhpcyBpcyBhIHZlcnkgbG9uZyB0ZXh0IHRvIHRlc3QgdGhlIFpMaWIgY29tcHJlc3Npb24gbWV0aG9k'))

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