【发布时间】:2016-07-22 06:04:38
【问题描述】:
我已通过 JDBC 连接到我的新 DB2 数据库,并正在尝试创建和插入一个临时表:
String createTemporaryTable = "declare global temporary table temporary_table (RECORD smallint) ON COMMIT PRESERVE ROWS in TEMPTABLESPACE";
statement.execute(createTemporaryTable);
String insert = "INSERT INTO temporary_table (RECORD) VALUES (1)";
statement.execute(insert);
connection.commit();
这会导致
“DB2 SQL 错误:SQLCODE=-204, SQLSTATE=42704”
创建一个普通表并以这种方式插入不会导致错误。有什么需要配置的吗?
【问题讨论】:
标签: insert db2 temp-tables