IS_UUID

IS_UUID checks if the input argment is a valid UUID string of one of the following formats:

  • xxxxxxxxxxxx4xxxBxxxxxxxxxxxxxxx,

  • xxxxxxxx-xxxx-4xxx-Bxxx-xxxxxxxxxxxx,

  • {xxxxxxxxxxxx4xxxBxxxxxxxxxxxxxxx},

  • {xxxxxxxx-xxxx-4xxx-Bxxx-xxxxxxxxxxxx},

A string consisting of 32 '0's (zero) denoting a Nil UUID, or 32 'f's denoting a Universal UUID where x is is a valid hexadecimal digit in upper or lower case. If the input is a string literal, then it must be quoted just like any string literal.

If the input string conforms to these formats it returns TRUE, otherwise it returns FALSE.

It returns NULL if the input is NULL.

Example 1

SELECT IS_UUID('{e24e8de0-d663-428f-baaa-1be5f019cd25}') FROM DUAL;

The output is:

IS_UUID('{E

-----------

TRUE

Example 2

SELECT IS_UUID('{d20f8c3cde134b958d25eff3fbdb7e71}') FROM DUAL;

The output is:

IS_UUID('{D
-----------
FALSE