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

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.

LONGVARBINARY (byte[])

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

The LONGVARBINARY data type represents a variable length binary type, or byte[] in Java, or Types.LONGVARBINARY in JDBC.

This data type is mostly offered as a compatibility type as the difference between this type and other variable length binary types like VARBINARY (byte[]) and BLOB (byte[]) is not very well defined.

DDL support

Dialect support

This example using jOOQ:

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

Translates to the following dialect specific expressions:

Access, Snowflake

CREATE TABLE t (
  c binary
)

ASE

CREATE TABLE t (
  c varbinary NULL
)

Aurora MySQL, DB2, Derby, Firebird, Hana, Informix, MariaDB, MemSQL, MySQL, Oracle, SQLite

CREATE TABLE t (
  c blob
)

Aurora Postgres, Postgres, YugabyteDB

CREATE TABLE t (
  c bytea
)

BigQuery, CockroachDB

CREATE TABLE t (
  c bytes
)

ClickHouse

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

Databricks

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

DuckDB, Trino

CREATE TABLE t (
  c varbinary
)

Exasol, H2, HSQLDB

CREATE TABLE t (
  c longvarbinary
)

Redshift

CREATE TABLE t (
  c varbyte
)

SQLDataWarehouse

CREATE TABLE t (
  c varbinary(8000)
)

SQLServer

CREATE TABLE t (
  c varbinary(max)
)

Sybase

CREATE TABLE t (
  c long binary NULL
)

Teradata

CREATE TABLE t (
  c varbinary(32000)
)

Vertica

CREATE TABLE t (
  c long varbinary
)
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"), LONGVARBINARY)

Translates to the following dialect specific expressions:

Access

cstr(c)

ASE, DuckDB, Trino

CAST(c AS varbinary)

Aurora MySQL, Databricks, MariaDB, MemSQL, MySQL, Snowflake

CAST(c AS binary)

Aurora Postgres, Postgres, YugabyteDB

CAST(c AS bytea)

BigQuery, CockroachDB

CAST(c AS bytes)

ClickHouse

CAST(c AS Nullable(longvarbinary))

DB2, Derby, Firebird, Hana, Informix, SQLite

CAST(c AS blob)

Exasol, H2, HSQLDB

CAST(c AS longvarbinary)

Oracle

to_blob(c)

Redshift

CAST(c AS varbyte)

SQLDataWarehouse

CAST(c AS varbinary(8000))

SQLServer

CAST(c AS varbinary(max))

Sybase

CAST(c AS long binary)

Teradata

CAST(c AS varbinary(32000))

Vertica

CAST(c AS long varbinary)
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