All versions: 3.11 | Development versions: 3.12

Most databases support a variety of SET statements to set session specific environment variables. jOOQ supports two of these set statements that are particularly useful when running DDL scripts:

SET CATALOG catalogname;
SET SCHEMA schemaname;
create.setCatalog("catalogname").execute();
create.setSchema("schemaname").execute();

Depending on whether your database supports catalogs and schemas, the above SET statements may be supported in your database.

In MariaDB, MySQL, SQL Server, the SET CATALOG statement is emulated using:

USE catalogname;

In Oracle, the SET SCHEMA statement is emulated using:

ALTER SESSION SET CURRENT_SCHEMA = schemaname;
The jOOQ Logo