[#6123] Emulate CREATE TABLE AS for DB2 using CREATE TABLE and INSERT
This commit is contained in:
parent
a650105fec
commit
4100b2ef86
@ -54,11 +54,15 @@ import static org.jooq.SQLDialect.POSTGRES;
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.impl.DSL.field;
|
||||
import static org.jooq.impl.DSL.insertInto;
|
||||
import static org.jooq.impl.DSL.name;
|
||||
import static org.jooq.impl.Keywords.K_AS;
|
||||
import static org.jooq.impl.Keywords.K_AUTO_INCREMENT;
|
||||
import static org.jooq.impl.Keywords.K_BEGIN;
|
||||
import static org.jooq.impl.Keywords.K_CREATE;
|
||||
import static org.jooq.impl.Keywords.K_DEFAULT;
|
||||
import static org.jooq.impl.Keywords.K_END;
|
||||
import static org.jooq.impl.Keywords.K_EXECUTE_IMMEDIATE;
|
||||
import static org.jooq.impl.Keywords.K_GENERATED_BY_DEFAULT_AS_IDENTITY;
|
||||
import static org.jooq.impl.Keywords.K_GLOBAL_TEMPORARY;
|
||||
import static org.jooq.impl.Keywords.K_IDENTITY;
|
||||
@ -71,6 +75,7 @@ import static org.jooq.impl.Keywords.K_ON_COMMIT_PRESERVE_ROWS;
|
||||
import static org.jooq.impl.Keywords.K_TABLE;
|
||||
import static org.jooq.impl.Keywords.K_TEMPORARY;
|
||||
import static org.jooq.impl.Keywords.K_WITH_DATA;
|
||||
import static org.jooq.impl.Keywords.K_WITH_NO_DATA;
|
||||
import static org.jooq.impl.Tools.DataKey.DATA_SELECT_INTO_TABLE;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -241,6 +246,9 @@ final class CreateTableImpl<R extends Record> extends AbstractQuery implements
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
acceptCreateTableAsSelect(ctx);
|
||||
}
|
||||
@ -358,6 +366,42 @@ final class CreateTableImpl<R extends Record> extends AbstractQuery implements
|
||||
ctx.end(CREATE_TABLE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private final void toSQLCreateTableName(Context<?> ctx) {
|
||||
ctx.start(CREATE_TABLE_NAME)
|
||||
.visit(K_CREATE)
|
||||
|
||||
@ -261,6 +261,7 @@ final class Keywords {
|
||||
public static final Keyword K_WITH_CHECK_OPTION = keyword("with check option");
|
||||
public static final Keyword K_WITH_DATA = keyword("with data");
|
||||
public static final Keyword K_WITH_LOCK = keyword("with lock");
|
||||
public static final Keyword K_WITH_NO_DATA = keyword("with no data");
|
||||
public static final Keyword K_WITH_PRIMARY_KEY = keyword("with primary key");
|
||||
public static final Keyword K_WITH_READ_ONLY = keyword("with read only");
|
||||
public static final Keyword K_WITH_ROLLUP = keyword("with rollup");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user