meta data for this page
  •  

CHAR_TO_UUID()

Available in: DSQL, PSQL

Added in: 2.5

Description

Converts a human-readable 36-char UUID string to the corresponding 16-byte UUID.

Result type: CHAR(16) CHARACTER SET OCTETS

Syntax

CHAR_TO_UUID (ascii_uuid)

ascii_uuid ::= a string of length 36 with:
               * '-' (hyphen) at positions 9, 14, 19 and 24;
               * valid hex digits at every other position.

Examples

select char_to_uuid('A0bF4E45-3029-2a44-D493-4998c9b439A3') from rdb$database
-- returns A0BF4E4530292A44D4934998C9B439A3 (16-byte string)

select char_to_uuid('A0bF4E45-3029-2A44-X493-4998c9b439A3') from rdb$database
-- error: -Human readable UUID argument for CHAR_TO_UUID must
--        have hex digit at position 20 instead of "X (ASCII 88)"