The jOOQ User Manual : SQL building : Column expressions : System functions : CURRENT_SCHEMA | previous : next |
New versions: Dev (3.15) | Latest (3.14) | 3.13 | 3.12 | 3.11 | 3.10 | 3.9 | 3.8 | Old versions: 3.7
CURRENT_SCHEMA
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
The CURRENT_SCHEMA()
function produces the dialect dependent expression to produce the current default schema for the JDBC connection.
SELECT current_schema;
create.select(currentSchema()).fetch();
The result being, for example
+----------------+ | current_schema | +----------------+ | public | +----------------+
Dialect support
This example using jOOQ:
currentSchema()
Translates to the following dialect specific expressions:
-- AURORA_MYSQL, MARIADB, MYSQL DATABASE() -- AURORA_POSTGRES, DB2, HSQLDB, POSTGRES CURRENT_SCHEMA -- CUBRID, FIREBIRD, SQLITE '' -- DERBY CURRENT SCHEMA -- H2 SCHEMA() -- ORACLE user -- SQLDATAWAREHOUSE, SQLSERVER schema_name() -- TERADATA DATABASE -- VERTICA CURRENT_SCHEMA() -- ACCESS, ASE, BIGQUERY, COCKROACHDB, EXASOL, HANA, IGNITE, INFORMIX, MEMSQL, REDSHIFT, SNOWFLAKE, SYBASE /* UNSUPPORTED */
(These are currently generated with jOOQ 3.15, see #10141)
Feedback
Do you have any feedback about this page? We'd love to hear it!