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
This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.
INSTANT (Instant)
Supported by ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
The INSTANT
data type represents an offset date time type with time zone fixed to UTC, or java.time.Instant
in Java, or Types.TIMESTAMP_WITH_TIMEZONE
in JDBC.
Some dialects support an explicit precision flag on this data type. If absent, the default is dialect specific.
DDL support
Dialect support
This example using jOOQ:
createTable("t").column("c", INSTANT)
Translates to the following dialect specific expressions:
Access, Aurora MySQL, DB2, Derby, Hana, Informix, MariaDB, MemSQL, MySQL, Redshift, SQLite, Vertica
CREATE TABLE t ( c instant )
ASE, Sybase
CREATE TABLE t ( c instant NULL )
Aurora Postgres, DuckDB, Exasol, Firebird, H2, HSQLDB, Oracle, Postgres, Teradata, Trino, YugabyteDB
CREATE TABLE t ( c timestamp with time zone )
BigQuery
CREATE TABLE t ( c timestamp )
ClickHouse
CREATE TABLE t ( c Nullable(instant) ) ENGINE Log()
CockroachDB
CREATE TABLE t ( c timestamptz )
Databricks
CREATE TABLE t ( c timestamp ) TBLPROPERTIES( 'delta.columnMapping.mode' = 'name', 'delta.feature.allowColumnDefaults' = 'supported' )
Snowflake
CREATE TABLE t ( c timestamp_tz )
SQLDataWarehouse, SQLServer
CREATE TABLE t ( c datetimeoffset )
Generated with jOOQ 3.21. Support in older jOOQ versions may differ. Translate your own SQL on our website
cast(field("c"), INSTANT)
Translates to the following dialect specific expressions:
Access
cstr(c)
ASE, Aurora MySQL, DB2, Derby, Hana, Informix, MariaDB, MemSQL, MySQL, Redshift, SQLite, Sybase, Vertica
CAST(c AS instant)
Aurora Postgres, DuckDB, Exasol, Firebird, H2, HSQLDB, Oracle, Postgres, Teradata, Trino, YugabyteDB
CAST(c AS timestamp with time zone)
BigQuery, Databricks
CAST(c AS timestamp)
ClickHouse
CAST(c AS Nullable(instant))
CockroachDB
CAST(c AS timestamptz)
Snowflake
CAST(c AS timestamp_tz)
SQLDataWarehouse, SQLServer
CAST(c AS datetimeoffset)
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!