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
BOOLEAN (Boolean)
Supported by ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
The BOOLEAN
data type represents a boolean type, or java.lang.Boolean
in Java, or Types.BOOLEAN
in JDBC.
While all RDBMS supportBOOLEAN
expressions in the form of aorg.jooq.Condition
, not all RDBMS support Column expressions of typeBOOLEAN
. If such boolean type support is unavailable in a dialect, jOOQ will just map the type to INTEGER (Integer) with possible values being0
and1
.
createTable("t").column("c", BOOLEAN)
Translates to the following dialect specific expressions:
Access, SQLDataWarehouse, SQLServer
CREATE TABLE t ( c bit )
ASE, Sybase
CREATE TABLE t ( c bit NULL )
Aurora MySQL, Aurora Postgres, CockroachDB, Derby, DuckDB, Exasol, Firebird, H2, HSQLDB, Hana, Informix, MariaDB, MemSQL, MySQL, Postgres, Redshift, SQLite, Snowflake, Trino, Vertica, YugabyteDB
CREATE TABLE t ( c boolean )
BigQuery
CREATE TABLE t ( c bool )
ClickHouse
CREATE TABLE t ( c Nullable(boolean) ) ENGINE Log()
Databricks
CREATE TABLE t ( c boolean ) TBLPROPERTIES( 'delta.columnMapping.mode' = 'name', 'delta.feature.allowColumnDefaults' = 'supported' )
DB2
CREATE TABLE t ( c smallint )
Oracle, Teradata
CREATE TABLE t ( c number )
Generated with jOOQ 3.21. Support in older jOOQ versions may differ. Translate your own SQL on our website
cast(field("c"), BOOLEAN)
Translates to the following dialect specific expressions:
Access
cbool(c)
ASE, SQLDataWarehouse, SQLServer, Sybase
CAST(c AS bit)
Aurora MySQL, MariaDB, MemSQL, MySQL
CAST(c AS unsigned)
Aurora Postgres, CockroachDB, Databricks, Derby, DuckDB, Exasol, Firebird, H2, HSQLDB, Hana, Informix, Postgres, Redshift, SQLite, Snowflake, Trino, Vertica, YugabyteDB
CAST(c AS boolean)
BigQuery
CAST(c AS bool)
ClickHouse
CAST(c AS Nullable(boolean))
DB2
CAST(c AS smallint)
Oracle, Teradata
CAST(c AS number(1))
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!