DECODE()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Decrypts the string using the given key.
USAGE
DECODE(encrypt_string, password_string)
Argument Name | Description |
---|---|
| The encrypted string to decode |
| The password to use |
DETAILS
DECODE()
is a string function that decodes and returns a string that was previously encoded using ENCODE()
.
The password_string
value must match the one used when the string was encoded.
A NULL
is returned if any argument is NULL
.
For the opposite conversion, see ENCODE().
EXAMPLES
SET @data = HEX(ENCODE('information', '1@mariadb-#'));
SELECT DECODE(UNHEX(@data), '1@mariadb-#');
+-------------------------------------+
| DECODE(UNHEX(@data), '1@mariadb-#') |
+-------------------------------------+
| information |
+-------------------------------------+