©SQL :: Manager
HomeProgram InformationTechnical detailsFree downloadDonate for a cup of coffee
myway SQL Manager for MySQL and MariaDB, Download on Uptodown
SQL functionMySQLMariaDB

The UNCOMPRESS SQL Function in MySQL and MariaDB - Decompress binary string

UNCOMPRESSSyntax:UNCOMPRESS(Binary string)
Return value:CHAR
Function type:Encryption & Compression
Function Description

The UNCOMPRESS() function decompresses a "Binary string" and returns the result as a character string.

This function requires MySQL or MariaDB to be compiled with a compression library such as zlib, otherwise the return value is always NULL.

If the "Binary string" contains no characters, the function returns an empty string.

If the "Binary string" is invalid and cannot be decompressed, the function returns NULL.

If the value of the "Binary string" is NULL, the UNCOMPRESS() function returns NULL.


Strings can be compressed with the COMPRESS() function.

SQL Examples for the UNCOMPRESS function

 1
 2
 3
 4
 5
 6
 7
 8
 9

SELECT uncompress(unhex('18000000789C0B492D2E5108C124006AD508A1'));
SELECT uncompress(unhex('09000000789C3334323604230008CD01C3'));

SELECT uncompress('09000000789C3334323604230008CD01C3');

SELECT uncompress('');
SELECT uncompress(null);

uncompress(unhex('18000000789C0B492D2E5108C124006AD508A1'))
Test Test Test Test Test
uncompress(unhex('09000000789C3334323604230008CD01C3'))
123123123
uncompress('09000000789C3334323604230008CD01C3')
NULL
uncompress('')
 
uncompress(null)
NULL
The examples were created with the MyWAY SQL manager: Download

How to use the UNCOMPRESS() function in MySQL and MariaDB databases

The UNCOMPRESS() function in MySQL and MariaDB is used for decompressing data, where compressed with the function COMPRESS(). The function takes a compressed binary string as input and returns the original uncompressed string. UNCOMPRESS() is commonly used in applications where compressed data has been stored in the database and the original uncompressed data needs to be retrieved, for example when the disk space required for large datasets should be reduced without giving up the opportunity to retrieve the original data when needed.

The function can only decompress data that was previously compressed with the COMPRESS() function.
TRIM_ORACLETRUNCATEUCASEUNCOMPRESSUNHEXUNIX_TIMESTAMPUPPER

Further MySQL und MariaDB SQL Encryption & Compression

AES_DECRYPTAES_DECRYPT(String, Key)
More about AES_DECRYPT Function

AES_ENCRYPTAES_ENCRYPT(String, Key)
More about AES_ENCRYPT Function

COMPRESSCOMPRESS(String)
More about COMPRESS Function

DECODEDECODE(Binary string, Password)
More about DECODE Function

DES_DECRYPTDES_DECRYPT(Binary string [, Key])
More about DES_DECRYPT Function

DES_ENCRYPTDES_ENCRYPT(String [, Key])
More about DES_ENCRYPT Function

ENCODEENCODE(String, Password)
More about ENCODE Function

ENCRYPTENCRYPT(String [, Salt])
More about ENCRYPT Function

FROM_BASE64FROM_BASE64(String)
More about FROM_BASE64 Function

MD5MD5(String)
More about MD5 Function

OLD_PASSWORDOLD_PASSWORD(String)
More about OLD_PASSWORD Function

PASSWORDPASSWORD(String)
More about PASSWORD Function

RANDOM_BYTESRANDOM_BYTES(Length)
More about RANDOM_BYTES Function

SHASHA(String)
More about SHA Function

SHA1SHA1(String)
More about SHA1 Function

SHA2SHA2(String, Length)
More about SHA2 Function

TO_BASE64TO_BASE64(String)
More about TO_BASE64 Function

Numeric functionsString functionsRegular ExpressionsDate and Time functions
Comparison functionsEncryption & CompressionConversion functionsNULL functions
Aggregate functionsWindow functionsJSON functionsGeometric functions
Sequence functionsInformation functionsDynamic ColumnsMiscellaneous functions
More information about the UNCOMPRESS SQL function: mysql.com and mariadb.com
Updated: 2023-09-24ImprintContactTerms & conditionsPrivacy & CookiesUpdatesSitemapFacebookLinkedinTwitterStatistics©2020-2024 Heino Cunze-Fischer