Firebird Documentation IndexFirebird 2.5 Language Ref. UpdateInternal functions → CHAR_TO_UUID()
Firebird Home Firebird Home Prev: CHAR_LENGTH(), CHARACTER_LENGTH()Firebird Documentation IndexUp: Internal functionsNext: COALESCE()

CHAR_TO_UUID()

Tip

Find a more recent version at Firebird 5.0 Language Reference: 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)"

See also: UUID_TO_CHAR(), GEN_UUID()

Prev: CHAR_LENGTH(), CHARACTER_LENGTH()Firebird Documentation IndexUp: Internal functionsNext: COALESCE()
Firebird Documentation IndexFirebird 2.5 Language Ref. UpdateInternal functions → CHAR_TO_UUID()