Available in versions: Dev (3.21) | Latest (3.20) | 3.19 | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11

UUID (UUID)

Supported by ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

The UUID data type represents a UUID value, or java.util.UUID in Java. It has no representation in JDBC.

DDL support

Dialect support

This example using jOOQ:

createTable("t").column("c", UUID)

Translates to the following dialect specific expressions:

Access, SQLDataWarehouse, SQLServer

CREATE TABLE t (
  c uniqueidentifier
)

ASE

CREATE TABLE t (
  c varchar(36) NULL
)

Aurora MySQL, DB2, Derby, Firebird, Hana, MariaDB, MemSQL, MySQL, SQLite, Snowflake, Teradata, Vertica

CREATE TABLE t (
  c varchar(36)
)

Aurora Postgres, CockroachDB, DuckDB, Exasol, H2, HSQLDB, Postgres, Redshift, Trino, YugabyteDB

CREATE TABLE t (
  c uuid
)

BigQuery

CREATE TABLE t (
  c string
)

ClickHouse

CREATE TABLE t (
  c Nullable(UUID)
)
ENGINE Log()

Databricks

CREATE TABLE t (
  c varchar(36)
)
TBLPROPERTIES(
  'delta.columnMapping.mode' = 'name',
  'delta.feature.allowColumnDefaults' = 'supported'
)

Informix

CREATE TABLE t (
  c lvarchar(36)
)

Oracle

CREATE TABLE t (
  c varchar2(36)
)

Sybase

CREATE TABLE t (
  c uniqueidentifier NULL
)
Generated with jOOQ 3.21. Support in older jOOQ versions may differ. Translate your own SQL on our website

Cast support

Dialect support

This example using jOOQ:

cast(field("c"), UUID)

Translates to the following dialect specific expressions:

Access

cstr(c)

ASE, SQLite, Teradata

CAST(c AS varchar)

Aurora MySQL, MariaDB, MemSQL, MySQL

CAST(c AS char)

Aurora Postgres, CockroachDB, DuckDB, Exasol, H2, HSQLDB, Postgres, Redshift, Trino, YugabyteDB

CAST(c AS uuid)

BigQuery

CAST(c AS string)

ClickHouse

CAST(c AS Nullable(UUID))

DB2, Databricks, Derby, Firebird, Hana, Informix, Vertica

CAST(c AS varchar(36))

Oracle, Snowflake

CAST(c AS varchar2(36))

SQLDataWarehouse, SQLServer, Sybase

CAST(c AS uniqueidentifier)
Generated with jOOQ 3.21. Support in older jOOQ versions may differ. Translate your own SQL on our website

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo