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.
CURRENT_CATALOG
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
The CURRENT_CATALOG()
function produces the dialect dependent expression to produce the current default catalog for the JDBC connection.
SELECT current_catalog;
create.select(currentCatalog()).fetch();
The result being, for example
+-----------------+ | current_catalog | +-----------------+ | my_database | +-----------------+
In some dialects, the schema and the catalog is the same thing, in case of which this function produces the same value as CURRENT_SCHEMA
Dialect support
This example using jOOQ:
currentCatalog()
Translates to the following dialect specific expressions:
Aurora MySQL, MariaDB, MemSQL, MySQL
database()
Aurora Postgres, CockroachDB, Databricks, Postgres, Snowflake, YugabyteDB
current_database()
ClickHouse
currentDatabase()
Firebird, SQLite
''
Informix
dbinfo('dbname')
SQLDataWarehouse, SQLServer
db_name()
ASE, Access, BigQuery, DB2, Derby, DuckDB, Exasol, H2, HSQLDB, Hana, Oracle, Redshift, Sybase, Teradata, Trino, Vertica
/* UNSUPPORTED */
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!