BIN_TO_UUID

Converts a binary UUID value to a string UUID value.

Syntax

BIN_TO_UUID(binary_uuid)

Arguments

binary_uuid: A binary UUID value.

Return Type

VARCHAR(36)

Remarks

If the argument is an invalid UUID value, it returns SQL NULL.

Examples

Returns the UUID in string format.

SELECT BIN_TO_UUID(SYS_GUID()) AS string_uuid_value;
+--------------------------------------+
| string_uuid_value                    |
+--------------------------------------+
| c591b267-59a8-4d8c-89de-f16c5951bf31 |
+--------------------------------------+

SYS_GUID() returns a new GUID in every call, the output may differ if called multiple times.

Last modified: November 12, 2024

Was this article helpful?