GENERATE_UUID_BINARY

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 result of the function is a BINARY(16) value. The result cannot be null.

GENERATE_UUID_BINARY is a non-deterministic function.

Note

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

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. See VARCHAR_FORMAT_BINARY.

Example

  • Generate a UUID value. This generates a BINARY(16) string value.
    VALUES GENERATE_UUID_BINARY()
    For example, this binary string could be generated: BX'D83D6360181841EB9804B622A1FE5492'