UUID_STRING
functionsupportedCore SQL functionsGenerates either a version 4 (random) or version 5 (named) RFC 4122-compliant universally unique identifier (UUID) as a formatted string.
Syntax
UUID_STRING()
UUID_STRING( '<uuid>' , '<name>' )
Parameters
| Name | Required | Description |
|---|---|---|
'uuid' | required | A valid UUID string. This value is the namespace used to generate the returned UUID. |
'name' | required | The name used to generate the returned UUID. |
Returns
This function returns a 128-bit value, formatted as a string (VARCHAR data type).
Usage notes
- UUID_STRING supports generating two versions of UUIDs, both compliant with RFC 4122:
- A version 4 (random) UUID is returned when no arguments are provided to the function. For random-number generation, the 64-bit Mersenne twister known as MT19937-64 is used.
- A version 5 (named) UUID can be produced by providing a uuid string (known as the namespace) as the first argument and a name string as the second argument.