GENERATE_UUID_BINARY scalar function

The GENERATE_UUID_BINARY function returns the binary string representation of a Universally Unique Identifier (UUID) using the version 4 algorithm.

Read syntax diagramSkip visual syntax diagramGENERATE_UUID_BINARY()

The schema is SYSIBM.

The function is defined as non-deterministic.

Results

The result of the function is a BINARY(16) value.

The result cannot be null.

Usage notes

To convert from the BINARY(16) form of a UUID value to the CHAR(36) representation of the value, use the VARCHAR_FORMAT_BINARY scalar function.

Example

The following example shows the command syntax for generating a BINARY(16) string UUID value:
value.VALUES GENERATE_UUID_BINARY()
The following example shows the format of a generated BINARY(16) UUID:
x'D83D6360181841EB9804B622A1FE5492'